summaryrefslogtreecommitdiff
path: root/src/example
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-02-22 18:17:06 +0800
committerchai <chaifix@163.com>2020-02-22 18:17:06 +0800
commit9c89460e136ed6c6c43704d9a3a15105e0f006b0 (patch)
treecd56f1dfc10650cfbfe7007ee3432ee32227edc3 /src/example
parentd49f3d3f73709a9a7c0bce53aa13ed28a2bd27cb (diff)
*wog
Diffstat (limited to 'src/example')
-rw-r--r--src/example/01_dot/01_dot.c1
-rw-r--r--src/example/02_cube/02_cube.c1
-rw-r--r--src/example/03_texture/03_texture.c9
-rw-r--r--src/example/04_bloom/04_bloom.c1
-rw-r--r--src/example/example.h10
5 files changed, 9 insertions, 13 deletions
diff --git a/src/example/01_dot/01_dot.c b/src/example/01_dot/01_dot.c
index e2902ca..3305137 100644
--- a/src/example/01_dot/01_dot.c
+++ b/src/example/01_dot/01_dot.c
@@ -10,7 +10,6 @@ void onloaddot(void* data) {
}
void oneventdot(void* data) {
- SDL_Event* e = (SDL_Event*)data;
}
void onupdatedot(void*data) {
diff --git a/src/example/02_cube/02_cube.c b/src/example/02_cube/02_cube.c
index 4e540e0..7e0840e 100644
--- a/src/example/02_cube/02_cube.c
+++ b/src/example/02_cube/02_cube.c
@@ -26,7 +26,6 @@ void onloadcube(void* data) {
}
void oneventcube(void* data) {
- SDL_Event* e = (SDL_Event*)data;
}
float _t = 0;
diff --git a/src/example/03_texture/03_texture.c b/src/example/03_texture/03_texture.c
index ab39298..f10c41a 100644
--- a/src/example/03_texture/03_texture.c
+++ b/src/example/03_texture/03_texture.c
@@ -40,7 +40,7 @@ static Mesh* yingham_mesh;
static Texture* cyborg_albedo;
static Mesh* cyborg_mesh;
-void onloadtexture(void* data) {
+void onload_texture(void* data) {
ssr_matrixmode(MATRIX_PROJECTION);
ssr_loadidentity();
ssr_perspective(90, ssr_getaspect(), 0.1, 10);
@@ -66,14 +66,13 @@ void onloadtexture(void* data) {
cyborg_mesh = mesh_loadfromobj("res/cyborg/cyborg.obj");
}
-void oneventtexture(void* data) {
- SDL_Event* e = (SDL_Event*)data;
+void onevent_texture(void* data) {
}
static float _t = 0;
static Quat q;
-void onupdatetexture(void*data) {
+void onupdate_texture(void*data) {
uint dt = *(uint*)data;
_t += dt / 1000.f;
@@ -100,7 +99,7 @@ void onupdatetexture(void*data) {
ssr_setuniformmat4(0, &world2object);
}
-void ondrawtexture(void*data) {
+void ondraw_texture(void*data) {
ssr_clearcolor(0xff202020);
ssr_cleardepth();
ssr_clearstencil(0);
diff --git a/src/example/04_bloom/04_bloom.c b/src/example/04_bloom/04_bloom.c
index 4a79669..037a9e1 100644
--- a/src/example/04_bloom/04_bloom.c
+++ b/src/example/04_bloom/04_bloom.c
@@ -58,7 +58,6 @@ void onloadbloom(void* data) {
}
void oneventbloom(void* data) {
- SDL_Event* e = (SDL_Event*)data;
}
static float _t = 0;
diff --git a/src/example/example.h b/src/example/example.h
index 6cb9a64..bcf9ebc 100644
--- a/src/example/example.h
+++ b/src/example/example.h
@@ -3,13 +3,13 @@
#include "../ssr.h"
#include "../util/type.h"
-#include "SDL2/SDL.h"
+//#include "SDL2/SDL.h"
#define EXAMPLE(i)\
-extern void onload##i(void*);\
-extern void onevent##i(void*);\
-extern void onupdate##i(void*);\
-extern void ondraw##i(void*);
+extern void onload_##i(void*);\
+extern void onevent_##i(void*);\
+extern void onupdate_##i(void*);\
+extern void ondraw_##i(void*);
#define EXAMPLECUR texture