Skip to content

Commit 113eae8

Browse files
committed
Fix c_canvas_glfw_minimal example
The latest D3D11 changes prevented it from building.
1 parent 11a06e9 commit 113eae8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

examples/c_canvas_glfw_minimal/c_canvas_glfw_minimal.c

+10-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
#include <stdio.h>
1616
#include <stdlib.h>
1717

18+
#ifndef GLFW_TRUE
19+
#define GLFW_TRUE 1
20+
#endif
21+
1822
static void HandleGLFWError(int errorCode, const char *description);
1923
static const void *LoadGLFunction(const char *name, void *userdata);
2024
static void HandleKeypress(GLFWwindow *window, int key, int scancode, int action, int mods);
@@ -44,9 +48,11 @@ int main(int argc, const char **argv) {
4448
PFGLDestFramebufferCreateFullWindow(&(PFVector2I){640, 480});
4549
PFGLRendererRef renderer = PFGLRendererCreate(PFGLDeviceCreate(PF_GL_VERSION_GL3, 0),
4650
PFFilesystemResourceLoaderLocate(),
47-
dest_framebuffer,
51+
&(PFRendererMode){PF_RENDERER_LEVEL_D3D9},
4852
&(PFRendererOptions){
49-
(PFColorF){1.0, 1.0, 1.0, 1.0}, PF_RENDERER_OPTIONS_FLAGS_HAS_BACKGROUND_COLOR
53+
dest_framebuffer,
54+
(PFColorF){1.0, 1.0, 1.0, 1.0},
55+
PF_RENDERER_OPTIONS_FLAGS_HAS_BACKGROUND_COLOR
5056
});
5157

5258
// Make a canvas. We're going to draw a house.
@@ -72,7 +78,8 @@ int main(int argc, const char **argv) {
7278

7379
// Render the canvas to screen.
7480
PFSceneRef scene = PFCanvasCreateScene(canvas);
75-
PFSceneProxyRef scene_proxy = PFSceneProxyCreateFromSceneAndRayonExecutor(scene);
81+
PFSceneProxyRef scene_proxy =
82+
PFSceneProxyCreateFromSceneAndRayonExecutor(scene, PF_RENDERER_LEVEL_D3D9);
7683
PFSceneProxyBuildAndRenderGL(scene_proxy, renderer, PFBuildOptionsCreate());
7784
glfwSwapBuffers(window);
7885

0 commit comments

Comments
 (0)