diff options
Diffstat (limited to 'progs')
-rw-r--r-- | progs/demos/.gitignore | 1 | ||||
-rw-r--r-- | progs/demos/fslight.c | 2 | ||||
-rw-r--r-- | progs/demos/rain.cxx | 2 | ||||
-rw-r--r-- | progs/egl/Makefile | 16 | ||||
-rw-r--r-- | progs/egl/eglinfo.c | 15 | ||||
-rw-r--r-- | progs/fp/.gitignore | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | progs/fp/Makefile | 10 | ||||
-rw-r--r-- | progs/fp/add-swz.txt | 5 | ||||
-rw-r--r-- | progs/fp/fp-tri.c | 2 | ||||
-rw-r--r-- | progs/fp/local.txt | 11 | ||||
-rw-r--r-- | progs/fp/mul-swz.txt | 3 | ||||
-rw-r--r-- | progs/fp/negate.txt | 6 | ||||
-rw-r--r-- | progs/glsl/.gitignore | 1 | ||||
-rw-r--r-- | progs/tests/mipmap_view.c | 5 | ||||
-rw-r--r-- | progs/trivial/Makefile | 3 | ||||
-rw-r--r-- | progs/trivial/dlist-degenerate.c | 153 | ||||
-rw-r--r-- | progs/vpglsl/.gitignore | 1 | ||||
-rw-r--r-- | progs/xdemos/glxinfo.c | 1 |
18 files changed, 212 insertions, 26 deletions
diff --git a/progs/demos/.gitignore b/progs/demos/.gitignore index 3693fafd4e..f033a0505d 100644 --- a/progs/demos/.gitignore +++ b/progs/demos/.gitignore @@ -8,6 +8,7 @@ cubemap drawpix engine extfuncs.h +fbo_firecube fire fogcoord fplight diff --git a/progs/demos/fslight.c b/progs/demos/fslight.c index e79b5cc197..c7931f4697 100644 --- a/progs/demos/fslight.c +++ b/progs/demos/fslight.c @@ -45,7 +45,7 @@ static GLint uTexture; static GLuint SphereList, RectList, CurList; static GLint win = 0; -static GLboolean anim = GL_TRUE; +static GLboolean anim = 0*GL_TRUE; static GLboolean wire = GL_FALSE; static GLboolean pixelLight = GL_TRUE; diff --git a/progs/demos/rain.cxx b/progs/demos/rain.cxx index 5c53d4248c..59b6471ef8 100644 --- a/progs/demos/rain.cxx +++ b/progs/demos/rain.cxx @@ -114,7 +114,7 @@ static void calcposobs(void) rainParticle::setRainingArea(obs[0]-7.0f,-0.2f,obs[2]-7.0f,obs[0]+7.0f,8.0f,obs[2]+7.0f); } -static void printstring(void *font, char *string) +static void printstring(void *font, const char *string) { int len,i; diff --git a/progs/egl/Makefile b/progs/egl/Makefile index 75cd411d93..f31c21e87e 100644 --- a/progs/egl/Makefile +++ b/progs/egl/Makefile @@ -36,56 +36,56 @@ demo1.o: demo1.c $(HEADERS) demo2: demo2.o $(TOP)/$(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) $(LDFLAGS) demo2.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) demo2.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ demo2.o: demo2.c $(HEADERS) $(CC) -c $(CFLAGS) -I$(TOP)/include demo2.c demo3: demo3.o $(TOP)/$(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) $(LDFLAGS) demo3.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) demo3.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ demo3.o: demo3.c $(HEADERS) $(CC) -c $(CFLAGS) -I$(TOP)/include demo3.c egltri: egltri.o $(TOP)/$(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) egltri.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) -o $@ + $(CC) $(CFLAGS) egltri.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) -o $@ egltri.o: egltri.c $(HEADERS) $(CC) -c $(CFLAGS) -I$(TOP)/include egltri.c eglinfo: eglinfo.o $(TOP)/$(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) $(LDFLAGS) eglinfo.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) eglinfo.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) -o $@ eglinfo.o: eglinfo.c $(HEADERS) $(CC) -c $(CFLAGS) -I$(TOP)/include eglinfo.c eglgears: eglgears.o $(TOP)/$(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) $(LDFLAGS) eglgears.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) eglgears.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ eglgears.o: eglgears.c $(HEADERS) $(CC) -c $(CFLAGS) -I$(TOP)/include eglgears.c peglgears: peglgears.o $(TOP)/$(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) peglgears.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ + $(CC) $(CFLAGS) peglgears.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ peglgears.o: peglgears.c $(HEADERS) $(CC) -c $(CFLAGS) -I$(TOP)/include peglgears.c xeglgears: xeglgears.o $(TOP)/$(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) xeglgears.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ + $(CC) $(CFLAGS) xeglgears.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ xeglgears.o: xeglgears.c $(HEADERS) $(CC) -c $(CFLAGS) -I$(TOP)/include xeglgears.c xegl_tri: xegl_tri.o $(TOP)/$(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) xegl_tri.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ + $(CC) $(CFLAGS) xegl_tri.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ xegl_tri.o: xegl_tri.c $(HEADERS) $(CC) -c $(CFLAGS) -I$(TOP)/include xegl_tri.c diff --git a/progs/egl/eglinfo.c b/progs/egl/eglinfo.c index 89feec9be4..14620a9759 100644 --- a/progs/egl/eglinfo.c +++ b/progs/egl/eglinfo.c @@ -48,9 +48,9 @@ PrintConfigs(EGLDisplay d) eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs); printf("Configurations:\n"); - printf(" bf lv d st colorbuffer dp st vis supported\n"); - printf(" id sz l b ro r g b a th cl id surfaces \n"); - printf("---------------------------------------------------\n"); + printf(" bf lv d st colorbuffer dp st ms vis supported\n"); + printf(" id sz l b ro r g b a th cl ns b id surfaces \n"); + printf("--------------------------------------------------------\n"); for (i = 0; i < numConfigs; i++) { EGLint id, size, level; EGLint red, green, blue, alpha; @@ -58,6 +58,7 @@ PrintConfigs(EGLDisplay d) EGLint surfaces; EGLint doubleBuf = 1, stereo = 0; EGLint vid; + EGLint samples, sampleBuffers; char surfString[100] = ""; eglGetConfigAttrib(d, configs[i], EGL_CONFIG_ID, &id); @@ -73,6 +74,9 @@ PrintConfigs(EGLDisplay d) eglGetConfigAttrib(d, configs[i], EGL_NATIVE_VISUAL_ID, &vid); eglGetConfigAttrib(d, configs[i], EGL_SURFACE_TYPE, &surfaces); + eglGetConfigAttrib(d, configs[i], EGL_SAMPLES, &samples); + eglGetConfigAttrib(d, configs[i], EGL_SAMPLE_BUFFERS, &sampleBuffers); + if (surfaces & EGL_WINDOW_BIT) strcat(surfString, "win,"); if (surfaces & EGL_PBUFFER_BIT) @@ -86,12 +90,13 @@ PrintConfigs(EGLDisplay d) if (strlen(surfString) > 0) surfString[strlen(surfString) - 1] = 0; - printf("0x%02x %2d %2d %c %c %2d %2d %2d %2d %2d %2d 0x%02x %-12s\n", + printf("0x%02x %2d %2d %c %c %2d %2d %2d %2d %2d %2d %2d%2d 0x%02x %-12s\n", id, size, level, doubleBuf ? 'y' : '.', stereo ? 'y' : '.', red, green, blue, alpha, - depth, stencil, vid, surfString); + depth, stencil, + samples, sampleBuffers, vid, surfString); } } diff --git a/progs/fp/.gitignore b/progs/fp/.gitignore index b265f1fed7..aa51f76c9b 100644 --- a/progs/fp/.gitignore +++ b/progs/fp/.gitignore @@ -40,3 +40,4 @@ tri-swz tri-swz2 tri-tex tri-xpd +fp-tri diff --git a/progs/fp/Makefile b/progs/fp/Makefile index ab43cde4f3..ef6644cce2 100644..100755 --- a/progs/fp/Makefile +++ b/progs/fp/Makefile @@ -67,21 +67,15 @@ getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress. texrect: texrect.o readtex.o -<<<<<<< HEAD:progs/fp/Makefile $(CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@ -======= - $(APP_CC) texrect.o readtex.o $(LIBS) -o $@ ->>>>>>> origin/gallium-0.1:progs/fp/Makefile +# $(APP_CC) texrect.o readtex.o $(LIBS) -o $@ texrect.o: texrect.c readtex.h $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ invert: invert.o readtex.o -<<<<<<< HEAD:progs/fp/Makefile $(CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@ -======= - $(APP_CC) invert.o readtex.o $(LIBS) -o $@ ->>>>>>> origin/gallium-0.1:progs/fp/Makefile +# $(APP_CC) invert.o readtex.o $(LIBS) -o $@ invert.o: invert.c readtex.h $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ diff --git a/progs/fp/add-swz.txt b/progs/fp/add-swz.txt new file mode 100644 index 0000000000..5ec51bcb84 --- /dev/null +++ b/progs/fp/add-swz.txt @@ -0,0 +1,5 @@ +!!ARBfp1.0 +TEMP R0; +ADD R0, fragment.color, fragment.color; +ADD result.color, R0.xxxx, R0; +END diff --git a/progs/fp/fp-tri.c b/progs/fp/fp-tri.c index c07cfa2076..843f897871 100644 --- a/progs/fp/fp-tri.c +++ b/progs/fp/fp-tri.c @@ -130,6 +130,8 @@ static void Display(void) { glClear(GL_COLOR_BUFFER_BIT); + glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, 1.0, 1.0, 0.0, 0.0); + glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 1, 0.0, 0.0, 1.0, 1.0); glBegin(GL_TRIANGLES); glColor3f(0,0,1); glVertex3f( 0.9, -0.9, -30.0); diff --git a/progs/fp/local.txt b/progs/fp/local.txt new file mode 100644 index 0000000000..6cb2a2f13c --- /dev/null +++ b/progs/fp/local.txt @@ -0,0 +1,11 @@ +!!ARBfp1.0 +TEMP R0; +PARAM c[4] = { { 0, 0, 0, 0 }, + program.local[0..1], + { 1, 1, 1, 1 } }; +MOV R0, c[1]; +SUB R0, R0, c[0]; +ADD R0, R0, c[2]; +MUL R0, R0, c[3]; +MOV result.color, R0; +END diff --git a/progs/fp/mul-swz.txt b/progs/fp/mul-swz.txt new file mode 100644 index 0000000000..7ef2f58633 --- /dev/null +++ b/progs/fp/mul-swz.txt @@ -0,0 +1,3 @@ +!!ARBfp1.0 +MUL result.color, fragment.color.zyxw, fragment.color; +END diff --git a/progs/fp/negate.txt b/progs/fp/negate.txt new file mode 100644 index 0000000000..3d00a04a58 --- /dev/null +++ b/progs/fp/negate.txt @@ -0,0 +1,6 @@ +!!ARBfp1.0 +# this should result in fragment color passing through unchanged +TEMP R0; +ADD R0, fragment.color, fragment.color; +ADD result.color, R0, -fragment.color; +END diff --git a/progs/glsl/.gitignore b/progs/glsl/.gitignore index 09340ff2ad..978e31c6cc 100644 --- a/progs/glsl/.gitignore +++ b/progs/glsl/.gitignore @@ -7,6 +7,7 @@ extfuncs.h mandelbrot multitex noise +pointcoord points readtex.c readtex.h diff --git a/progs/tests/mipmap_view.c b/progs/tests/mipmap_view.c index 117e201718..54607b8939 100644 --- a/progs/tests/mipmap_view.c +++ b/progs/tests/mipmap_view.c @@ -21,6 +21,8 @@ static int TexWidth = 256, TexHeight = 256; static int WinWidth = 1044, WinHeight = 900; static GLfloat Bias = 0.0; static GLboolean ScaleQuads = GL_FALSE; +static GLint Win = 0; + static void @@ -145,6 +147,7 @@ Key(unsigned char key, int x, int y) ScaleQuads = !ScaleQuads; break; case 27: + glutDestroyWindow(Win); exit(0); break; } @@ -238,7 +241,7 @@ main(int argc, char *argv[]) glutInitWindowPosition(0, 0); glutInitWindowSize(WinWidth, WinHeight); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); - glutCreateWindow(argv[0]); + Win = glutCreateWindow(argv[0]); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutDisplayFunc(Display); diff --git a/progs/trivial/Makefile b/progs/trivial/Makefile index 95223e45b9..28c0b12fa4 100644 --- a/progs/trivial/Makefile +++ b/progs/trivial/Makefile @@ -19,6 +19,7 @@ SOURCES = \ dlist-dangling.c \ dlist-edgeflag-dangling.c \ dlist-edgeflag.c \ + dlist-degenerate.c \ drawarrays.c \ drawelements.c \ drawrange.c \ @@ -74,7 +75,6 @@ SOURCES = \ quadstrip-cont.c \ quadstrip-flat.c \ quadstrip.c \ - tri-orig.c \ tri-alpha.c \ tri-blend-color.c \ tri-blend-max.c \ @@ -93,6 +93,7 @@ SOURCES = \ tri-flat.c \ tri-fog.c \ tri-mask-tri.c \ + tri-orig.c \ tri-query.c \ tri-scissor-tri.c \ tri-stencil.c \ diff --git a/progs/trivial/dlist-degenerate.c b/progs/trivial/dlist-degenerate.c new file mode 100644 index 0000000000..c7f2d2a6e9 --- /dev/null +++ b/progs/trivial/dlist-degenerate.c @@ -0,0 +1,153 @@ +/** + * Test display list corner cases. + */ + + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <GL/glut.h> + + +static int Win; +static GLfloat Xrot = 0, Yrot = 0, Zrot = 0; +static GLboolean Anim = GL_FALSE; +static GLuint List1 = 0, List2 = 0; + + +static void +Idle(void) +{ + Xrot += 3.0; + Yrot += 4.0; + Zrot += 2.0; + glutPostRedisplay(); +} + + +static void +Draw(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glPushMatrix(); + glRotatef(Xrot, 1, 0, 0); + glRotatef(Yrot, 0, 1, 0); + glRotatef(Zrot, 0, 0, 1); + + glCallList(List1); + glCallList(List2); + + glPopMatrix(); + + glutSwapBuffers(); +} + + +static void +Reshape(int width, int height) +{ + glViewport(0, 0, width, height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0, 0.0, -15.0); +} + + +static void +Key(unsigned char key, int x, int y) +{ + const GLfloat step = 3.0; + (void) x; + (void) y; + switch (key) { + case 'a': + Anim = !Anim; + if (Anim) + glutIdleFunc(Idle); + else + glutIdleFunc(NULL); + break; + case 'z': + Zrot -= step; + break; + case 'Z': + Zrot += step; + break; + case 27: + glutDestroyWindow(Win); + exit(0); + break; + } + glutPostRedisplay(); +} + + +static void +SpecialKey(int key, int x, int y) +{ + const GLfloat step = 3.0; + (void) x; + (void) y; + switch (key) { + case GLUT_KEY_UP: + Xrot -= step; + break; + case GLUT_KEY_DOWN: + Xrot += step; + break; + case GLUT_KEY_LEFT: + Yrot -= step; + break; + case GLUT_KEY_RIGHT: + Yrot += step; + break; + } + glutPostRedisplay(); +} + + +static void +Init(void) +{ + /* List1: start of primitive */ + List1 = glGenLists(1); + glNewList(List1, GL_COMPILE); + glBegin(GL_POLYGON); + glVertex2f(-1, -1); + glVertex2f( 1, -1); + glEndList(); + + /* List2: end of primitive */ + List2 = glGenLists(1); + glNewList(List2, GL_COMPILE); + glVertex2f( 1, 1); + glVertex2f(-1, 1); + glEnd(); + glEndList(); + + glEnable(GL_DEPTH_TEST); +} + + +int +main(int argc, char *argv[]) +{ + glutInit(&argc, argv); + glutInitWindowPosition(0, 0); + glutInitWindowSize(400, 400); + glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); + Win = glutCreateWindow(argv[0]); + glutReshapeFunc(Reshape); + glutKeyboardFunc(Key); + glutSpecialFunc(SpecialKey); + glutDisplayFunc(Draw); + if (Anim) + glutIdleFunc(Idle); + Init(); + glutMainLoop(); + return 0; +} diff --git a/progs/vpglsl/.gitignore b/progs/vpglsl/.gitignore new file mode 100644 index 0000000000..a5ff993525 --- /dev/null +++ b/progs/vpglsl/.gitignore @@ -0,0 +1 @@ +vp-tris diff --git a/progs/xdemos/glxinfo.c b/progs/xdemos/glxinfo.c index 6cf127afa2..445d3ea94b 100644 --- a/progs/xdemos/glxinfo.c +++ b/progs/xdemos/glxinfo.c @@ -447,7 +447,6 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits) if (!ctx) { fprintf(stderr, "Error: glXCreateContext failed\n"); XFree(visinfo); - XDestroyWindow(dpy, win); return; } |