summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-02-24 12:37:12 +0800
committerchai <chaifix@163.com>2020-02-24 12:37:12 +0800
commit87b9482459c1a27b8756514473ae392453db39ec (patch)
treeb47b5130f4a346adeaf26cde9787f43ab6949e57 /src/main.c
parent538cb1cd010a3323ad61239a12a4134ef4dceca6 (diff)
*window
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c18
1 files changed, 9 insertions, 9 deletions
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);