From 87b9482459c1a27b8756514473ae392453db39ec Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 24 Feb 2020 12:37:12 +0800 Subject: *window --- src/main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index edc31bb..292d663 100644 --- a/src/main.c +++ b/src/main.c @@ -8,28 +8,27 @@ #include "extend/camera.h" #define SCREEN_WIDTH 600 -#define SCREEN_HEIGHT 500 +#define SCREEN_HEIGHT 480 typedef void(*F)(void*); + F onload; F onupdate; F onevent; F ondraw; -/*macro这里需要绕一下弯*/ /*https://stackoverflow.com/questions/1489932/how-to-concatenate-twice-with-the-c-preprocessor-and-expand-a-macro-as-in-arg*/ #define SETEXAMPLEF(f, e) \ -f = f##_##e; + f = f##_##e; #define SETEXAMPLE(i) \ -SETEXAMPLEF(onload, i)\ -SETEXAMPLEF(ondraw, i)\ -SETEXAMPLEF(onevent, i)\ -SETEXAMPLEF(onupdate, i) + SETEXAMPLEF(onload, i)\ + SETEXAMPLEF(ondraw, i)\ + SETEXAMPLEF(onevent, i)\ + SETEXAMPLEF(onupdate, i) int main(int argc, char* argv[]) { - wog_Window* wnd = wog_createWindow("Soft Shader Room", SCREEN_WIDTH, SCREEN_HEIGHT, 500, 500, 0); - wog_show(wnd); + wog_Window* wnd = wog_createWindow("Soft Shade Room", SCREEN_WIDTH, SCREEN_HEIGHT, 500, 500, 0); wog_Surface* surface = wog_getsurface(wnd); // ARGB format /* init ssr */ ssr_Config config = { @@ -40,6 +39,7 @@ int main(int argc, char* argv[]) { ssr_init(&config); SETEXAMPLE(EXAMPLECUR); onload(NULL); + wog_show(wnd); /*set up global camera*/ Camera cam; camera_init(&cam, wnd); -- cgit v1.1-26-g67d0