diff options
author | michal <michal@michal-laptop.(none)> | 2007-07-27 10:05:40 +0200 |
---|---|---|
committer | michal <michal@michal-laptop.(none)> | 2007-07-27 10:05:40 +0200 |
commit | e0a26b046764ae80748b347395ab1b27de83651e (patch) | |
tree | ea702756a3e9cedc3b3c41241cbff0956ddc82bc /progs | |
parent | 0360b49afbcd839f99ba0745d01cf9dc5be4d122 (diff) | |
parent | e3cef5887540016a6d198598cb50bebe09e3f4cf (diff) |
Merge branch 'master' of git+ssh://[email protected]/git/mesa/mesa into softpipe_0_1_branch
Diffstat (limited to 'progs')
-rw-r--r-- | progs/osdemos/ostest1.c | 7 | ||||
-rw-r--r-- | progs/samples/Makefile.mgw | 33 | ||||
-rw-r--r-- | progs/xdemos/pbdemo.c | 9 |
3 files changed, 38 insertions, 11 deletions
diff --git a/progs/osdemos/ostest1.c b/progs/osdemos/ostest1.c index 001e3686162..2c7adfc3537 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 11935405783..3b2fd785def 100644 --- a/progs/samples/Makefile.mgw +++ b/progs/samples/Makefile.mgw @@ -26,6 +26,15 @@ # Email : [email protected] # Web : http://www.geocities.com/dborca +# MinGW samples makefile updated for Mesa 7.0 +# +# Updated : by Heromyth, on 2007-7-21 +# Email : [email protected] +# 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 efdfdfa4522..7db0017b33e 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*/ |