Commit f2c82961 authored by Sam Lantinga's avatar Sam Lantinga

Implemented multi-window OpenGL program with test framework.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401960
parent 3b997f23
...@@ -60,6 +60,8 @@ SDL_SendWindowEvent(SDL_WindowID windowID, Uint8 windowevent, int data1, ...@@ -60,6 +60,8 @@ SDL_SendWindowEvent(SDL_WindowID windowID, Uint8 windowevent, int data1,
if (data1 == window->x && data2 == window->y) { if (data1 == window->x && data2 == window->y) {
return 0; return 0;
} }
window->x = data1;
window->y = data2;
break; break;
case SDL_WINDOWEVENT_RESIZED: case SDL_WINDOWEVENT_RESIZED:
if (window->flags & SDL_WINDOW_FULLSCREEN) { if (window->flags & SDL_WINDOW_FULLSCREEN) {
...@@ -68,6 +70,8 @@ SDL_SendWindowEvent(SDL_WindowID windowID, Uint8 windowevent, int data1, ...@@ -68,6 +70,8 @@ SDL_SendWindowEvent(SDL_WindowID windowID, Uint8 windowevent, int data1,
if (data1 == window->w && data2 == window->h) { if (data1 == window->w && data2 == window->h) {
return 0; return 0;
} }
window->w = data1;
window->h = data2;
break; break;
case SDL_WINDOWEVENT_MINIMIZED: case SDL_WINDOWEVENT_MINIMIZED:
if (window->flags & SDL_WINDOW_MINIMIZED) { if (window->flags & SDL_WINDOW_MINIMIZED) {
......
...@@ -53,8 +53,8 @@ testgamma$(EXE): $(srcdir)/testgamma.c ...@@ -53,8 +53,8 @@ testgamma$(EXE): $(srcdir)/testgamma.c
testgl$(EXE): $(srcdir)/testgl.c testgl$(EXE): $(srcdir)/testgl.c
$(CC) -o $@ $? $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@ $(CC) -o $@ $? $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@
testgl2$(EXE): $(srcdir)/testgl2.c testgl2$(EXE): $(srcdir)/testgl2.c $(srcdir)/common.c
$(CC) -o $@ $? $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@ $(CC) -o $@ $(srcdir)/testgl2.c $(srcdir)/common.c $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@
testhread$(EXE): $(srcdir)/testhread.c testhread$(EXE): $(srcdir)/testhread.c
$(CC) -o $@ $? $(CFLAGS) $(LIBS) $(CC) -o $@ $? $(CFLAGS) $(LIBS)
......
This diff is collapsed.
...@@ -134,14 +134,14 @@ main(int argc, char *argv[]) ...@@ -134,14 +134,14 @@ main(int argc, char *argv[])
int consumed; int consumed;
consumed = CommonArg(state, i); consumed = CommonArg(state, i);
if (consumed < 0) {
fprintf(stderr, "Usage: %s %s", argv[0], CommonUsage(state));
quit(1);
}
if (consumed == 0) { if (consumed == 0) {
num_sprites = SDL_atoi(argv[i]); num_sprites = SDL_atoi(argv[i]);
consumed = 1; consumed = 1;
} }
if (consumed < 0) {
fprintf(stderr, "Usage: %s %s", argv[0], CommonUsage(state));
quit(1);
}
i += consumed; i += consumed;
} }
if (!CommonInit(state)) { if (!CommonInit(state)) {
...@@ -184,7 +184,7 @@ main(int argc, char *argv[]) ...@@ -184,7 +184,7 @@ main(int argc, char *argv[])
} }
} }
/* Loop, blitting sprites and waiting for a keystroke */ /* Main render loop */
frames = 0; frames = 0;
then = SDL_GetTicks(); then = SDL_GetTicks();
done = 0; done = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment