summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle K <kylek389@gmail.com>2011-01-17 17:59:39 -0600
committerKamil Kaminski <kamilkss@gmail.com>2011-01-17 17:59:39 -0600
commita45c12c116ef9ae77ded325423351cc34b6c0fb1 (patch)
treebd71f7d68d3fbcd19b21d14702101d51975f1655
parent95fb08d84d8cbcc23f2ac03cd3a51debed34541f (diff)
downloadGLPyramid-a45c12c116ef9ae77ded325423351cc34b6c0fb1.tar.gz
GLPyramid-a45c12c116ef9ae77ded325423351cc34b6c0fb1.tar.bz2
GLPyramid-a45c12c116ef9ae77ded325423351cc34b6c0fb1.zip
sdl: add icon to window heading
-rw-r--r--sdl/mingw322
-rw-r--r--sdl/pyramid.c10
-rw-r--r--sdl/tux.pngbin0 -> 563 bytes
3 files changed, 9 insertions, 3 deletions
diff --git a/sdl/mingw32 b/sdl/mingw32
index ff7555e..19e9fcd 100644
--- a/sdl/mingw32
+++ b/sdl/mingw32
@@ -7,7 +7,7 @@ ifdef DEBUG
else
CFLAGS = -Wall -std=c99 -O2 -march=native -mtune=native
endif
-LDFLAGS = -lglew32 -lopengl32 -lglu32 -lm -lfreeglut -lmingw32 -lsdlmain -lsdl -mwindows
+LDFLAGS = -lglew32 -lopengl32 -lglu32 -lm -lfreeglut -lmingw32 -lsdlmain -lsdl -lsdl_image -mwindows
$(PROG): $(OBJS)
$(CC) -o $(PROG) $(OBJS) $(LDFLAGS)
diff --git a/sdl/pyramid.c b/sdl/pyramid.c
index 265ffcd..50b1833 100644
--- a/sdl/pyramid.c
+++ b/sdl/pyramid.c
@@ -26,6 +26,11 @@
#define FRAMES_PER_SECOND 60
/* function prototypes */
+static void resize(int, int);
+static void setup_opengl(void);
+static void keys(SDL_keysym *, unsigned int *, int);
+static void process_events(void);
+static void render(void);
/* global */
int program_running = 1;
@@ -213,7 +218,7 @@ static void keys(SDL_keysym *keysym, unsigned int *keys_held, int flag)
}
/* process SDL events */
-static void process_events()
+static void process_events(void)
{
SDL_Event event;
unsigned static int keys_held[323];
@@ -294,13 +299,14 @@ int main(int argc, char **argv)
{
SDL_Surface *screen;
- if (SDL_Init(SDL_INIT_VIDEO) < 0 )
+ if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0 )
{
fprintf(stderr, "unable to init SDL: %s\n", SDL_GetError());
exit(-1);
}
atexit(SDL_Quit);
SDL_WM_SetCaption("Textured Pyramid", NULL);
+ SDL_WM_SetIcon(IMG_Load("tux.png"), NULL);
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
diff --git a/sdl/tux.png b/sdl/tux.png
new file mode 100644
index 0000000..be09124
--- /dev/null
+++ b/sdl/tux.png
Binary files differ