From 76fb8089103e9dba9aaa7232c86d864d5874a08f Mon Sep 17 00:00:00 2001 From: Zhang Date: Sat, 21 Jul 2007 11:28:06 -0600 Subject: Fix a number of MINGW32 issues --- progs/samples/Makefile.mgw | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'progs') diff --git a/progs/samples/Makefile.mgw b/progs/samples/Makefile.mgw index 1193540578..3b2fd785de 100644 --- a/progs/samples/Makefile.mgw +++ b/progs/samples/Makefile.mgw @@ -26,6 +26,15 @@ # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca +# MinGW samples makefile updated for Mesa 7.0 +# +# Updated : by Heromyth, on 2007-7-21 +# Email : zxpmyth@yahoo.com.cn +# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work. +# The others havn't been tested yet. +# 2) The generated DLLs are *not* compatible with the ones built +# with the other compilers like VC8, especially for GLUT. +# 3) Although more tests are needed, it can be used individually! # # Available options: @@ -44,15 +53,31 @@ TOP = ../.. +include $(TOP)/configs/config.mgw +ALL_USING_STDCALL ?= 1 +GL_USING_STDCALL ?= 1 +GLUT_USING_STDCALL ?= 1 + CC = mingw32-gcc -CFLAGS = -Wall -W -pedantic +CFLAGS = -Wall -pedantic CFLAGS += -O2 -ffast-math CFLAGS += -I$(TOP)/include -I../util ifeq ($(FX),1) -CFLAGS += -DFX + CFLAGS += -DFX +endif + +CFLAGS += -DGLUT_DISABLE_ATEXIT_HACK + +ifeq ($(GL_USING_STDCALL),0) + CFLAGS += -DGL_NO_STDCALL +endif + +ifeq ($(GLUT_USING_STDCALL),1) + CFLAGS += -D_STDCALL_SUPPORTED +else + CFLAGS += -DGLUT_NO_STDCALL endif -CFLAGS += -DGLUT_DISABLE_ATEXIT_HACK -D_STDCALL_SUPPORTED -CFLAGS += -D_WINDEF_ -D_WINGDI_ + LD = mingw32-g++ LDFLAGS = -s -L$(TOP)/lib -- cgit v1.2.3 From ffc633c469d5056a8f3766243279cdf64b0f98c3 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 24 Jul 2007 09:19:22 -0600 Subject: fix logic error, typos --- progs/xdemos/pbdemo.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'progs') diff --git a/progs/xdemos/pbdemo.c b/progs/xdemos/pbdemo.c index efdfdfa452..7db0017b33 100644 --- a/progs/xdemos/pbdemo.c +++ b/progs/xdemos/pbdemo.c @@ -93,7 +93,7 @@ MakePbuffer( Display *dpy, int screen, int width, int height ) None }, { - /* Single bufferd, without depth buffer */ + /* Single buffered, without depth buffer */ GLX_RENDER_TYPE, GLX_RGBA_BIT, GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT, GLX_RED_SIZE, 1, @@ -105,7 +105,7 @@ MakePbuffer( Display *dpy, int screen, int width, int height ) None }, { - /* Double bufferd, without depth buffer */ + /* Double buffered, without depth buffer */ GLX_RENDER_TYPE, GLX_RGBA_BIT, GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT, GLX_RED_SIZE, 1, @@ -130,9 +130,8 @@ MakePbuffer( Display *dpy, int screen, int width, int height ) /* Get list of possible frame buffer configurations */ fbConfigs = ChooseFBConfig(dpy, screen, fbAttribs[attempt], &nConfigs); if (nConfigs==0 || !fbConfigs) { - printf("Error: glXChooseFBConfig failed\n"); - XCloseDisplay(dpy); - return 0; + printf("Note: glXChooseFBConfig(%s) failed\n", fbString[attempt]); + continue; } #if 0 /*DEBUG*/ -- cgit v1.2.3 From daaee90a26d007e261932c30bcaaca0282ead088 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 26 Jul 2007 08:22:47 -0600 Subject: clamp float colors --- progs/osdemos/ostest1.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'progs') diff --git a/progs/osdemos/ostest1.c b/progs/osdemos/ostest1.c index 001e368616..2c7adfc353 100644 --- a/progs/osdemos/ostest1.c +++ b/progs/osdemos/ostest1.c @@ -409,6 +409,8 @@ test(GLenum type, GLint bits, const char *filename) printf("Rendering %d bit/channel image: %s\n", bits, filename); + OSMesaColorClamp(GL_TRUE); + init_context(); render_image(); if (Gradient) @@ -421,7 +423,7 @@ test(GLenum type, GLint bits, const char *filename) if (WriteFiles && filename != NULL) { if (type == GL_UNSIGNED_SHORT) { GLushort *buffer16 = (GLushort *) buffer; - GLubyte *buffer8 = malloc(WIDTH * HEIGHT * 4); + GLubyte *buffer8 = (GLubyte *) malloc(WIDTH * HEIGHT * 4); int i; for (i = 0; i < WIDTH * HEIGHT * 4; i++) buffer8[i] = buffer16[i] >> 8; @@ -430,8 +432,9 @@ test(GLenum type, GLint bits, const char *filename) } else if (type == GL_FLOAT) { GLfloat *buffer32 = (GLfloat *) buffer; - GLubyte *buffer8 = malloc(WIDTH * HEIGHT * 4); + GLubyte *buffer8 = (GLubyte *) malloc(WIDTH * HEIGHT * 4); int i; + /* colors may be outside [0,1] so we need to clamp */ for (i = 0; i < WIDTH * HEIGHT * 4; i++) buffer8[i] = (GLubyte) (buffer32[i] * 255.0); write_ppm(filename, buffer8, WIDTH, HEIGHT); -- cgit v1.2.3