diff options
Diffstat (limited to 'progs')
-rw-r--r-- | progs/glsl/skinning.c | 3 | ||||
-rw-r--r-- | progs/glsl/texaaline.c | 3 | ||||
-rw-r--r-- | progs/glsl/twoside.c | 3 | ||||
-rw-r--r-- | progs/perf/common.c | 4 | ||||
-rw-r--r-- | progs/tests/copypixrate.c | 2 | ||||
-rw-r--r-- | progs/tests/random.c | 2 | ||||
-rw-r--r-- | progs/xdemos/pbdemo.c | 17 |
7 files changed, 31 insertions, 3 deletions
diff --git a/progs/glsl/skinning.c b/progs/glsl/skinning.c index 65ba98348b6..2b96f31d060 100644 --- a/progs/glsl/skinning.c +++ b/progs/glsl/skinning.c @@ -16,6 +16,9 @@ #include <GL/glut.h> #include "shaderutil.h" +#ifndef M_PI +#define M_PI 3.1415926535 +#endif static char *FragProgFile = "skinning.frag"; static char *VertProgFile = "skinning.vert"; diff --git a/progs/glsl/texaaline.c b/progs/glsl/texaaline.c index 7a5ac405bba..2e4f932ad60 100644 --- a/progs/glsl/texaaline.c +++ b/progs/glsl/texaaline.c @@ -14,6 +14,9 @@ #include <GL/glew.h> #include <GL/glut.h> +#ifndef M_PI +#define M_PI 3.1415926535 +#endif static GLint WinWidth = 300, WinHeight = 300; static GLint win = 0; diff --git a/progs/glsl/twoside.c b/progs/glsl/twoside.c index a57484f96cc..ce155d64e9e 100644 --- a/progs/glsl/twoside.c +++ b/progs/glsl/twoside.c @@ -16,6 +16,9 @@ #include <GL/glut.h> #include "shaderutil.h" +#ifndef M_PI +#define M_PI 3.1415926535 +#endif static GLint WinWidth = 300, WinHeight = 300; static char *FragProgFile = NULL; diff --git a/progs/perf/common.c b/progs/perf/common.c index 722f4b7b454..b6489ef918d 100644 --- a/progs/perf/common.c +++ b/progs/perf/common.c @@ -30,6 +30,10 @@ #include <stdlib.h> #include <stdarg.h> +#if defined(_MSC_VER) +#define snprintf _snprintf +#endif + /* Need to add a fflush windows console with mingw, otherwise nothing * shows up until program exit. May want to add logging here. diff --git a/progs/tests/copypixrate.c b/progs/tests/copypixrate.c index aa4acfc18b5..f63d59f3cec 100644 --- a/progs/tests/copypixrate.c +++ b/progs/tests/copypixrate.c @@ -69,7 +69,7 @@ DrawTestImage(void) static int Rand(int max) { - return ((int) random()) % max; + return ((int) rand()) % max; } diff --git a/progs/tests/random.c b/progs/tests/random.c index 4023674c05f..604b4d4088c 100644 --- a/progs/tests/random.c +++ b/progs/tests/random.c @@ -257,11 +257,11 @@ RandomPrimitive(void) Vcount++; for (i = 0; i < len; i++) { + int k = RandomInt(9); Vbuffer[Vcount].v[0] = RandomFloat(-3, 3); Vbuffer[Vcount].v[1] = RandomFloat(-3, 3); Vbuffer[Vcount].v[2] = RandomFloat(-3, 3); Vbuffer[Vcount].v[3] = RandomFloat(-3, 3); - int k = RandomInt(9); switch (k) { case 0: glVertex2fv(Vbuffer[Vcount].v); diff --git a/progs/xdemos/pbdemo.c b/progs/xdemos/pbdemo.c index 7db0017b33e..2573209336c 100644 --- a/progs/xdemos/pbdemo.c +++ b/progs/xdemos/pbdemo.c @@ -143,7 +143,7 @@ MakePbuffer( Display *dpy, int screen, int width, int height ) /* Create the pbuffer using first fbConfig in the list that works. */ for (i=0;i<nConfigs;i++) { - pBuffer = CreatePbuffer(dpy, screen, fbConfigs[i], width, height, preserve, largest); + pBuffer = CreatePbuffer(dpy, screen, fbConfigs[i], width, height, largest, preserve); if (pBuffer) { gFBconfig = fbConfigs[i]; gWidth = width; @@ -210,6 +210,21 @@ Setup(int width, int height) return 0; } + /* Test drawable queries */ + { + unsigned int v; + glXQueryDrawable( gDpy, gPBuffer, GLX_WIDTH, &v); + printf("GLX_WIDTH = %u\n", v); + glXQueryDrawable( gDpy, gPBuffer, GLX_HEIGHT, &v); + printf("GLX_HEIGHT = %u\n", v); + glXQueryDrawable( gDpy, gPBuffer, GLX_PRESERVED_CONTENTS, &v); + printf("GLX_PRESERVED_CONTENTS = %u\n", v); + glXQueryDrawable( gDpy, gPBuffer, GLX_LARGEST_PBUFFER, &v); + printf("GLX_LARGEST_PBUFFER = %u\n", v); + glXQueryDrawable( gDpy, gPBuffer, GLX_FBCONFIG_ID, &v); + printf("GLX_FBCONFIG_ID = %u\n", v); + } + /* Get corresponding XVisualInfo */ visInfo = GetVisualFromFBConfig(gDpy, gScreen, gFBconfig); if (!visInfo) { |