Skip to content

Commit

Permalink
[WIP] Dependency: reason-glfw -> 3.2.1002 (mono#61)
Browse files Browse the repository at this point in the history
Dependency: reason-glfw -> 3.2.1002
  • Loading branch information
bryphe authored Nov 23, 2018
1 parent 71d8a06 commit 991dffd
Show file tree
Hide file tree
Showing 5 changed files with 255 additions and 210 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"dependencies": {
"@esy-ocaml/reason": "^3.3.7",
"reason-fontkit": "^1.0.0",
"reason-glfw": "^1.0.0",
"reason-glfw": "^3.2.1002",
"reason-fontkit": "^1.1.0",
"reason-gl-matrix": "^0.2.0",
"reason-reactify": "^1.0.1",
"@opam/lwt": "^4.0.0",
Expand Down
8 changes: 4 additions & 4 deletions src/Core/App.re
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Reglfw.Glfw;
open Reglfw;

type reducer('s, 'a) = ('s, 'a) => 's;

Expand Down Expand Up @@ -52,11 +52,11 @@ let startWithState: startFunc('s, 'a) =
needsRender: true,
};

let _ = glfwInit();
let _ = Glfw.glfwInit();
let _ = initFunc(appInstance);

let appLoop = (_t: float) => {
glfwPollEvents();
Glfw.glfwPollEvents();
if (appInstance.needsRender) {
Performance.bench("renderWindows", () => {
List.iter(w => Window.render(w), getWindows(appInstance));
Expand All @@ -73,7 +73,7 @@ let startWithState: startFunc('s, 'a) =
false;
};

glfwRenderLoop(appLoop);
Glfw.glfwRenderLoop(appLoop);
};

let start = (initFunc: appInitFunc(unit, unit)) =>
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Window.re
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type keyEvent = {
type windowRenderCallback = unit => unit;
type t = {
mutable backgroundColor: Color.t,
glfwWindow: window,
glfwWindow: Window.t,
render: ref(option(windowRenderCallback)),
mutable width: int,
mutable height: int,
Expand Down
31 changes: 15 additions & 16 deletions src/Shaders/BasicShader.re
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
/**
* Basic Shader
*
*
* Simple shader demonstrating usage of attributes, uniforms, and varying parameters.
*/

open Shader;

let attribute: list(ShaderAttribute.t) = [
{
dataType: ShaderDataType.Vector3,
name: "aVertexPosition",
channel: Position,
}];

let uniform: list(ShaderUniform.t) = [{
{
dataType: ShaderDataType.Vector3,
name: "uColor",
usage: VertexShader,
}];
name: "aVertexPosition",
channel: Position,
},
];

let varying: list(ShaderVarying.t) = [{
let uniform: list(ShaderUniform.t) = [
{dataType: ShaderDataType.Vector3, name: "uColor", usage: VertexShader},
];

let varying: list(ShaderVarying.t) = [
{
dataType: ShaderDataType.Vector3,
name: "vColor",
precision: ShaderPrecision.Low,
}];

},
];

let vsShader = {|
gl_Position = vec4(aVertexPosition, 1.0);
Expand All @@ -40,7 +39,7 @@ let create = () => {
Shader.create(
~attributes=attribute,
~uniforms=uniform,
~varying=varying,
~varying,
~vertexShader=vsShader,
~fragmentShader=fsShader,
);
Expand Down
Loading

0 comments on commit 991dffd

Please sign in to comment.