summaryrefslogtreecommitdiffstats
path: root/menu_demo/bitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'menu_demo/bitmap.c')
-rw-r--r--menu_demo/bitmap.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/menu_demo/bitmap.c b/menu_demo/bitmap.c
index a13943b..1a32f68 100644
--- a/menu_demo/bitmap.c
+++ b/menu_demo/bitmap.c
@@ -1,4 +1,9 @@
-#include <windows.h>
+#ifdef G_OS_WIN32
+ #define WIN32_LEAN_AND_MEAN 1
+ #include <windows.h>
+ #define GL_BGR 0x80E0
+#endif
+
#include <GL/gl.h>
#include <GL/glu.h>
#include <stdio.h>
@@ -11,7 +16,7 @@
#define BITMAP_WIDTH 0x12
#define BITMAP_HEIGHT 0x16
-void load_image(char *filename)
+void BitmapLoad(char *filename)
{
GLuint texture;
FILE *bitmap;
@@ -41,7 +46,7 @@ void load_image(char *filename)
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
- gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, width, height, GL_RGB, GL_UNSIGNED_BYTE, imagedata);
+ gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, width, height, GL_BGR, GL_UNSIGNED_BYTE, imagedata);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);