summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
authormichal <michal@michal-laptop.(none)>2007-07-27 10:05:40 +0200
committermichal <michal@michal-laptop.(none)>2007-07-27 10:05:40 +0200
commite0a26b046764ae80748b347395ab1b27de83651e (patch)
treeea702756a3e9cedc3b3c41241cbff0956ddc82bc /progs
parent0360b49afbcd839f99ba0745d01cf9dc5be4d122 (diff)
parente3cef5887540016a6d198598cb50bebe09e3f4cf (diff)
Merge branch 'master' of git+ssh://michal@git.freedesktop.org/git/mesa/mesa into softpipe_0_1_branch
Diffstat (limited to 'progs')
-rw-r--r--progs/osdemos/ostest1.c7
-rw-r--r--progs/samples/Makefile.mgw33
-rw-r--r--progs/xdemos/pbdemo.c9
3 files changed, 38 insertions, 11 deletions
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);
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
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*/