From 025b140b2fd6860039a0d4b545130751473563c5 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Fri, 9 Nov 2007 08:19:27 -0500 Subject: Add a simple fps counter to the example --- progs/vp/vp-tris.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'progs/vp') diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c index 5dbe5ac835..e5be65e78c 100644 --- a/progs/vp/vp-tris.c +++ b/progs/vp/vp-tris.c @@ -7,6 +7,8 @@ #include #define GL_GLEXT_PROTOTYPES #include +#include +#include static const char *filename = NULL; static GLuint nr_steps = 4; @@ -18,8 +20,24 @@ static void usage( char *name ) fprintf( stderr, "options:\n" ); fprintf( stderr, " -f flat shaded\n" ); fprintf( stderr, " -nNr subdivision steps\n" ); + fprintf( stderr, " -fps show frames per second\n" ); } +unsigned show_fps = 0; +unsigned int frame_cnt = 0; +void alarmhandler(int); + +void alarmhandler (int sig) +{ + if (sig == SIGALRM) { + printf("%d frames in 5.0 seconds = %.3f FPS\n", frame_cnt, + frame_cnt / 5.0); + + frame_cnt = 0; + } + signal(SIGALRM, alarmhandler); + alarm(5); +} static void args(int argc, char *argv[]) { @@ -32,6 +50,9 @@ static void args(int argc, char *argv[]) else if (strcmp(argv[i], "-f") == 0) { glShadeModel(GL_FLAT); } + else if (strcmp(argv[i], "-fps") == 0) { + show_fps = 1; + } else if (i == argc - 1) { filename = argv[i]; } @@ -168,7 +189,11 @@ static void Display( void ) glEnd(); - glFlush(); + glFlush(); + if (show_fps) { + ++frame_cnt; + glutPostRedisplay(); + } } @@ -211,6 +236,10 @@ int main( int argc, char *argv[] ) glutDisplayFunc( Display ); args( argc, argv ); Init(); + if (show_fps) { + signal(SIGALRM, alarmhandler); + alarm(5); + } glutMainLoop(); return 0; } -- cgit v1.2.3 From 6f111e9c81a0c28f057092836a3b7fc6100cdb6d Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Thu, 13 Dec 2007 10:31:39 -0500 Subject: Don't generate spurious vs, move the enable a bit to do that. --- progs/vp/vp-tris.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'progs/vp') diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c index e5be65e78c..f9e6cdad74 100644 --- a/progs/vp/vp-tris.c +++ b/progs/vp/vp-tris.c @@ -90,7 +90,9 @@ static void Init( void ) } fprintf(stderr, "%.*s\n", sz, buf); - + + glEnable(GL_VERTEX_PROGRAM_NV); + glGenProgramsARB(1, &prognum); glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum); @@ -168,8 +170,6 @@ static void Display( void ) glClearColor(0.3, 0.3, 0.3, 1); glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - glEnable(GL_VERTEX_PROGRAM_NV); - glBegin(GL_TRIANGLES); -- cgit v1.2.3 From 0a4867bd4c20faf96af2df6ae31b83854082a820 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Sat, 29 Sep 2007 11:23:22 -0700 Subject: Ignore more generated files in progs/ Many of the directories in progs/ were missing .gitignore files or were tracking generated files. This patch is basically the process of running `make' in each directory and then finding the untracked files with `git-ls-files -o --exclude-per-directory=.gitignore'. The existing files were also sorted. --- progs/beos/.gitignore | 3 +++ progs/directfb/.gitignore | 4 ++++ progs/egl/.gitignore | 5 +++++ progs/fbdev/.gitignore | 1 + progs/miniglx/.gitignore | 6 ++++++ progs/osdemos/.gitignore | 8 ++++++++ progs/samples/.gitignore | 34 +++++++++++++++++----------------- progs/slang/.gitignore | 3 +++ progs/tests/.gitignore | 10 +++++++++- progs/tools/trace/.gitignore | 1 + progs/vp/.gitignore | 1 + 11 files changed, 58 insertions(+), 18 deletions(-) create mode 100644 progs/beos/.gitignore create mode 100644 progs/directfb/.gitignore create mode 100644 progs/egl/.gitignore create mode 100644 progs/fbdev/.gitignore create mode 100644 progs/miniglx/.gitignore create mode 100644 progs/osdemos/.gitignore create mode 100644 progs/slang/.gitignore create mode 100644 progs/tools/trace/.gitignore create mode 100644 progs/vp/.gitignore (limited to 'progs/vp') diff --git a/progs/beos/.gitignore b/progs/beos/.gitignore new file mode 100644 index 0000000000..53011ca2e6 --- /dev/null +++ b/progs/beos/.gitignore @@ -0,0 +1,3 @@ +demo +GLInfo +sample diff --git a/progs/directfb/.gitignore b/progs/directfb/.gitignore new file mode 100644 index 0000000000..55d65fb5b0 --- /dev/null +++ b/progs/directfb/.gitignore @@ -0,0 +1,4 @@ +df_gears +df_morph3d +df_reflect +multi_window diff --git a/progs/egl/.gitignore b/progs/egl/.gitignore new file mode 100644 index 0000000000..1751108235 --- /dev/null +++ b/progs/egl/.gitignore @@ -0,0 +1,5 @@ +demo1 +demo2 +demo3 +eglgears +eglinfo diff --git a/progs/fbdev/.gitignore b/progs/fbdev/.gitignore new file mode 100644 index 0000000000..b9ddf559fd --- /dev/null +++ b/progs/fbdev/.gitignore @@ -0,0 +1 @@ +glfbdevtest diff --git a/progs/miniglx/.gitignore b/progs/miniglx/.gitignore new file mode 100644 index 0000000000..f630f591f6 --- /dev/null +++ b/progs/miniglx/.gitignore @@ -0,0 +1,6 @@ +manytex +miniglxsample +miniglxtest +sample_server +sample_server2 +texline diff --git a/progs/osdemos/.gitignore b/progs/osdemos/.gitignore new file mode 100644 index 0000000000..5c78f12481 --- /dev/null +++ b/progs/osdemos/.gitignore @@ -0,0 +1,8 @@ +osdemo +osdemo16 +osdemo32 +ostest1 +readtex.c +readtex.h +showbuffer.c +showbuffer.h diff --git a/progs/samples/.gitignore b/progs/samples/.gitignore index 9635c7f450..f60d6e94ea 100644 --- a/progs/samples/.gitignore +++ b/progs/samples/.gitignore @@ -1,24 +1,41 @@ .cvsignore accum +anywin +bdemo +binfo bitmap1 bitmap2 blendeq blendxor +bugger copy cursor +demo depth eval +ffset fog font +font +incopy line logo +lthreads +lxdemo +lxgears +lxheads +lxinfo +lxpixmap nurb oglinfo olympic overlay +pend point prim quad +readtex.c +readtex.h select shape sphere @@ -28,20 +45,3 @@ stretch texture tri wave -bugger -pend -lthreads -lxdemo -lxgears -lxheads -lxinfo -lxpixmap -anywin -ffset -bdemo -binfo -incopy -demo -font -readtex.c -readtex.h diff --git a/progs/slang/.gitignore b/progs/slang/.gitignore new file mode 100644 index 0000000000..8a42b018e6 --- /dev/null +++ b/progs/slang/.gitignore @@ -0,0 +1,3 @@ +cltest +sotest +vstest diff --git a/progs/tests/.gitignore b/progs/tests/.gitignore index 2c0e16c35e..2455d5e9f7 100644 --- a/progs/tests/.gitignore +++ b/progs/tests/.gitignore @@ -1,5 +1,5 @@ .cvsignore -getproclist.h +afsmultiarb antialias arbfpspec arbfptest1 @@ -25,13 +25,21 @@ fogcoord fptest1 fptexture getprocaddress +getproclist.h +interleave invert +jkrahntest manytex multipal no_s3tc packedpixels pbo +prog_parameter projtex +random +readrate +readtex.c +readtex.h seccolor sharedtex stencil_wrap diff --git a/progs/tools/trace/.gitignore b/progs/tools/trace/.gitignore new file mode 100644 index 0000000000..afe0c5829e --- /dev/null +++ b/progs/tools/trace/.gitignore @@ -0,0 +1 @@ +gltrace.cc diff --git a/progs/vp/.gitignore b/progs/vp/.gitignore new file mode 100644 index 0000000000..a5ff993525 --- /dev/null +++ b/progs/vp/.gitignore @@ -0,0 +1 @@ +vp-tris -- cgit v1.2.3 From 2f13d4cd58ec2bd60fd9a31cb1b2fb4bc8ee4ec7 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 21 May 2008 13:17:48 +0100 Subject: vp-tris: use test name as window name --- progs/vp/vp-tris.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'progs/vp') diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c index f9e6cdad74..eb450cb598 100644 --- a/progs/vp/vp-tris.c +++ b/progs/vp/vp-tris.c @@ -230,7 +230,7 @@ int main( int argc, char *argv[] ) glutInitWindowPosition( 0, 0 ); glutInitWindowSize( 250, 250 ); glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH ); - glutCreateWindow(argv[0]); + glutCreateWindow(argv[argc-1]); glutReshapeFunc( Reshape ); glutKeyboardFunc( Key ); glutDisplayFunc( Display ); -- cgit v1.2.3 From 5b16730df8e19792ed92441857f586e0ec773a1f Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 18 Aug 2008 21:44:54 +0200 Subject: Port vp to Windows. --- progs/vp/vp-tris.c | 32 ++++++++++- progs/vp/windows/vp2003.sln | 21 +++++++ progs/vp/windows/vp2003.vcproj | 121 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 171 insertions(+), 3 deletions(-) create mode 100644 progs/vp/windows/vp2003.sln create mode 100644 progs/vp/windows/vp2003.vcproj (limited to 'progs/vp') diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c index eb450cb598..a65ac11dc3 100644 --- a/progs/vp/vp-tris.c +++ b/progs/vp/vp-tris.c @@ -5,10 +5,22 @@ #include #include #include -#define GL_GLEXT_PROTOTYPES #include + +#ifndef WIN32 #include #include +#define GL_GLEXT_PROTOTYPES +#else +#include +#endif + +#ifdef WIN32 +static PFNGLBINDPROGRAMARBPROC glBindProgramARB = NULL; +static PFNGLGENPROGRAMSARBPROC glGenProgramsARB = NULL; +static PFNGLPROGRAMSTRINGARBPROC glProgramStringARB = NULL; +static PFNGLISPROGRAMARBPROC glIsProgramARB = NULL; +#endif static const char *filename = NULL; static GLuint nr_steps = 4; @@ -25,6 +37,9 @@ static void usage( char *name ) unsigned show_fps = 0; unsigned int frame_cnt = 0; + +#ifndef WIN32 + void alarmhandler(int); void alarmhandler (int sig) @@ -39,6 +54,8 @@ void alarmhandler (int sig) alarm(5); } +#endif + static void args(int argc, char *argv[]) { GLint i; @@ -83,7 +100,7 @@ static void Init( void ) exit(1); } - sz = fread(buf, 1, sizeof(buf), f); + sz = (GLuint) fread(buf, 1, sizeof(buf), f); if (!feof(f)) { fprintf(stderr, "file too long\n"); exit(1); @@ -91,7 +108,14 @@ static void Init( void ) fprintf(stderr, "%.*s\n", sz, buf); - glEnable(GL_VERTEX_PROGRAM_NV); +#ifdef WIN32 + glBindProgramARB = (PFNGLBINDPROGRAMARBPROC) wglGetProcAddress( "glBindProgramARB" ); + glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC) wglGetProcAddress( "glGenProgramsARB" ); + glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC) wglGetProcAddress( "glProgramStringARB" ); + glIsProgramARB = (PFNGLISPROGRAMARBPROC) wglGetProcAddress( "glIsProgramARB" ); +#endif + + glEnable(GL_VERTEX_PROGRAM_ARB); glGenProgramsARB(1, &prognum); @@ -236,10 +260,12 @@ int main( int argc, char *argv[] ) glutDisplayFunc( Display ); args( argc, argv ); Init(); +#ifndef WIN32 if (show_fps) { signal(SIGALRM, alarmhandler); alarm(5); } +#endif glutMainLoop(); return 0; } diff --git a/progs/vp/windows/vp2003.sln b/progs/vp/windows/vp2003.sln new file mode 100644 index 0000000000..76de5cfd7f --- /dev/null +++ b/progs/vp/windows/vp2003.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vp2003", "vp2003.vcproj", "{E1C70416-98E7-4282-B6B2-6C9CF90B12C0}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {E1C70416-98E7-4282-B6B2-6C9CF90B12C0}.Debug.ActiveCfg = Debug|Win32 + {E1C70416-98E7-4282-B6B2-6C9CF90B12C0}.Debug.Build.0 = Debug|Win32 + {E1C70416-98E7-4282-B6B2-6C9CF90B12C0}.Release.ActiveCfg = Release|Win32 + {E1C70416-98E7-4282-B6B2-6C9CF90B12C0}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/progs/vp/windows/vp2003.vcproj b/progs/vp/windows/vp2003.vcproj new file mode 100644 index 0000000000..adca2c5073 --- /dev/null +++ b/progs/vp/windows/vp2003.vcproj @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 2858ec66c2dfb67c904cab5c56291b621c62720d Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 19 Aug 2008 14:43:19 +0200 Subject: Add support for NVIDIA programs. --- progs/vp/vp-tris.c | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) (limited to 'progs/vp') diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c index a65ac11dc3..3fe35f7e3e 100644 --- a/progs/vp/vp-tris.c +++ b/progs/vp/vp-tris.c @@ -20,6 +20,11 @@ static PFNGLBINDPROGRAMARBPROC glBindProgramARB = NULL; static PFNGLGENPROGRAMSARBPROC glGenProgramsARB = NULL; static PFNGLPROGRAMSTRINGARBPROC glProgramStringARB = NULL; static PFNGLISPROGRAMARBPROC glIsProgramARB = NULL; + +static PFNGLBINDPROGRAMNVPROC glBindProgramNV = NULL; +static PFNGLGENPROGRAMSNVPROC glGenProgramsNV = NULL; +static PFNGLLOADPROGRAMNVPROC glLoadProgramNV = NULL; +static PFNGLISPROGRAMNVPROC glIsProgramNV = NULL; #endif static const char *filename = NULL; @@ -108,20 +113,37 @@ static void Init( void ) fprintf(stderr, "%.*s\n", sz, buf); + if (strncmp( buf, "!!VP", 4 ) == 0) { #ifdef WIN32 - glBindProgramARB = (PFNGLBINDPROGRAMARBPROC) wglGetProcAddress( "glBindProgramARB" ); - glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC) wglGetProcAddress( "glGenProgramsARB" ); - glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC) wglGetProcAddress( "glProgramStringARB" ); - glIsProgramARB = (PFNGLISPROGRAMARBPROC) wglGetProcAddress( "glIsProgramARB" ); + glBindProgramNV = (PFNGLBINDPROGRAMNVPROC) wglGetProcAddress( "glBindProgramNV" ); + glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC) wglGetProcAddress( "glGenProgramsNV" ); + glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC) wglGetProcAddress( "glLoadProgramNV" ); + glIsProgramNV = (PFNGLISPROGRAMNVPROC) wglGetProcAddress( "glIsProgramNV" ); #endif - glEnable(GL_VERTEX_PROGRAM_ARB); + glEnable( GL_VERTEX_PROGRAM_NV ); + glGenProgramsNV( 1, &prognum ); + glBindProgramNV( GL_VERTEX_PROGRAM_NV, prognum ); + glLoadProgramNV( GL_VERTEX_PROGRAM_NV, prognum, sz, (const GLubyte *) buf ); + assert( glIsProgramNV( prognum ) ); + } + else { +#ifdef WIN32 + glBindProgramARB = (PFNGLBINDPROGRAMARBPROC) wglGetProcAddress( "glBindProgramARB" ); + glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC) wglGetProcAddress( "glGenProgramsARB" ); + glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC) wglGetProcAddress( "glProgramStringARB" ); + glIsProgramARB = (PFNGLISPROGRAMARBPROC) wglGetProcAddress( "glIsProgramARB" ); +#endif + + glEnable(GL_VERTEX_PROGRAM_ARB); - glGenProgramsARB(1, &prognum); + glGenProgramsARB(1, &prognum); - glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum); - glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - sz, (const GLubyte *) buf); + glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum); + glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, + sz, (const GLubyte *) buf); + assert(glIsProgramARB(prognum)); + } errno = glGetError(); printf("glGetError = %d\n", errno); @@ -133,7 +155,6 @@ static void Init( void ) printf("errorpos: %d\n", errorpos); printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); } - assert(glIsProgramARB(prognum)); } -- cgit v1.2.3 From 47e14cc0932346a1133840890ac2fbdf71ba8c1b Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 19 Aug 2008 14:44:41 +0200 Subject: Add NV_vertex_program specific tests. --- progs/vp/exp.txt | 5 +++++ progs/vp/log.txt | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 progs/vp/exp.txt create mode 100644 progs/vp/log.txt (limited to 'progs/vp') diff --git a/progs/vp/exp.txt b/progs/vp/exp.txt new file mode 100644 index 0000000000..601aae7d71 --- /dev/null +++ b/progs/vp/exp.txt @@ -0,0 +1,5 @@ +!!VP1.0 +EXP R0, v[COL0].x; +ADD o[COL0], R0.z, -R0.w; +MOV o[HPOS], v[OPOS]; +END diff --git a/progs/vp/log.txt b/progs/vp/log.txt new file mode 100644 index 0000000000..9b04268433 --- /dev/null +++ b/progs/vp/log.txt @@ -0,0 +1,6 @@ +!!VP1.0 +ADD R0, v[COL0], v[COL0]; +ADD R0, R0, R0; +LOG o[COL0], R0.x; +MOV o[HPOS], v[OPOS]; +END -- cgit v1.2.3 From 522139dd146450edfd3d2f07c627b32512a2c27e Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 12 Sep 2008 10:31:51 +0100 Subject: vp: add run script --- progs/vp/run.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 progs/vp/run.sh (limited to 'progs/vp') diff --git a/progs/vp/run.sh b/progs/vp/run.sh new file mode 100755 index 0000000000..fdd43d4a52 --- /dev/null +++ b/progs/vp/run.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +for i in *.txt ; do +echo $i +./vp-tris $i +done + -- cgit v1.2.3 From 5548a3072f73b8868746b640535c4774657dc306 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 14 Oct 2008 13:52:38 +0100 Subject: vp: add simple vertex transform test --- progs/vp/vp-tris.c | 11 +++++++++++ progs/vp/xform.txt | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 progs/vp/xform.txt (limited to 'progs/vp') diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c index 3fe35f7e3e..58014dd48d 100644 --- a/progs/vp/vp-tris.c +++ b/progs/vp/vp-tris.c @@ -155,6 +155,17 @@ static void Init( void ) printf("errorpos: %d\n", errorpos); printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)); } + + { + const float Ambient[4] = { 0.0, 1.0, 0.0, 0.0 }; + const float Diffuse[4] = { 1.0, 0.0, 0.0, 0.0 }; + const float Specular[4] = { 0.0, 0.0, 1.0, 0.0 }; + const float Emission[4] = { 0.0, 0.0, 0.0, 1.0 }; + glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, Ambient); + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, Diffuse); + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, Specular); + glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Emission); + } } diff --git a/progs/vp/xform.txt b/progs/vp/xform.txt new file mode 100644 index 0000000000..d1548f1f10 --- /dev/null +++ b/progs/vp/xform.txt @@ -0,0 +1,11 @@ +!!ARBvp1.0 +PARAM Emission = state.material.emission; +PARAM Ambient = state.material.ambient; +PARAM Diffuse = state.material.diffuse; +PARAM Specular = state.material.specular; +DP4 result.position.x, Ambient, vertex.position; +DP4 result.position.y, Diffuse, vertex.position; +DP4 result.position.z, Specular, vertex.position; +DP4 result.position.w, Emission, vertex.position; +MOV result.color, vertex.color; +END -- cgit v1.2.3 From c25adeae18a2cbd2c504210dff289af4764ecaf1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 28 Oct 2008 19:00:25 -0600 Subject: mesa: convert log/exp tests to ARB_v_p --- progs/vp/exp.txt | 9 +++++---- progs/vp/log.txt | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'progs/vp') diff --git a/progs/vp/exp.txt b/progs/vp/exp.txt index 601aae7d71..53ce71db96 100644 --- a/progs/vp/exp.txt +++ b/progs/vp/exp.txt @@ -1,5 +1,6 @@ -!!VP1.0 -EXP R0, v[COL0].x; -ADD o[COL0], R0.z, -R0.w; -MOV o[HPOS], v[OPOS]; +!!ARBvp1.0 +TEMP R0; +EXP R0, vertex.color.x; +SUB result.color, R0.z, R0.w; +MOV result.position, vertex.position; END diff --git a/progs/vp/log.txt b/progs/vp/log.txt index 9b04268433..6b4e94ed0e 100644 --- a/progs/vp/log.txt +++ b/progs/vp/log.txt @@ -1,6 +1,7 @@ -!!VP1.0 -ADD R0, v[COL0], v[COL0]; +!!ARBvp1.0 +TEMP R0; +ADD R0, vertex.color, vertex.color; ADD R0, R0, R0; -LOG o[COL0], R0.x; -MOV o[HPOS], v[OPOS]; +LOG result.color, R0.x; +MOV result.position, vertex.position; END -- cgit v1.2.3 From 91473dac5a5995664940918fa945b9bd6316da93 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 28 Oct 2008 19:00:56 -0600 Subject: mesa: use APP_CC compiler in progs/vp/ --- progs/vp/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'progs/vp') diff --git a/progs/vp/Makefile b/progs/vp/Makefile index 28d63237a4..41d025c574 100644 --- a/progs/vp/Makefile +++ b/progs/vp/Makefile @@ -26,13 +26,13 @@ INCLUDES = -I. -I$(TOP)/include -I../samples .SUFFIXES: .c .c: - $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@ + $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@ .c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ .S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ ##### TARGETS ##### -- cgit v1.2.3 From 54d684f23d3fb723d7f226b5ce093248476ab26a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 28 Oct 2008 19:01:38 -0600 Subject: move glut.h include --- progs/vp/vp-tris.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'progs/vp') diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c index 58014dd48d..e1ddb2e14d 100644 --- a/progs/vp/vp-tris.c +++ b/progs/vp/vp-tris.c @@ -5,7 +5,6 @@ #include #include #include -#include #ifndef WIN32 #include @@ -15,6 +14,8 @@ #include #endif +#include + #ifdef WIN32 static PFNGLBINDPROGRAMARBPROC glBindProgramARB = NULL; static PFNGLGENPROGRAMSARBPROC glGenProgramsARB = NULL; -- cgit v1.2.3 From 528a0a885e85907888738cd7b28fff1334697e50 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 23 Jan 2009 16:24:43 +0000 Subject: progs: Port vp-tris to glew. There was some wglGetProcAddress calls to setup extensions already, but including glext caused many compilation errors in MinGW. --- progs/SConscript | 1 + progs/vp/Makefile | 2 +- progs/vp/SConscript | 13 +++++++++++++ progs/vp/vp-tris.c | 31 ++----------------------------- 4 files changed, 17 insertions(+), 30 deletions(-) create mode 100644 progs/vp/SConscript (limited to 'progs/vp') diff --git a/progs/SConscript b/progs/SConscript index 245fc26725..ffb6de4f16 100644 --- a/progs/SConscript +++ b/progs/SConscript @@ -1,4 +1,5 @@ SConscript([ 'demos/SConscript', 'trivial/SConscript', + 'vp/SConscript', ]) diff --git a/progs/vp/Makefile b/progs/vp/Makefile index 41d025c574..58a0dacb22 100644 --- a/progs/vp/Makefile +++ b/progs/vp/Makefile @@ -8,7 +8,7 @@ TOP = ../.. include $(TOP)/configs/current -LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) +LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) SOURCES = \ vp-tris.c diff --git a/progs/vp/SConscript b/progs/vp/SConscript new file mode 100644 index 0000000000..640c5dd847 --- /dev/null +++ b/progs/vp/SConscript @@ -0,0 +1,13 @@ +Import('env') + +if not env['GLUT']: + Return() + +env = env.Clone() + +env.Prepend(LIBS = ['$GLUT_LIB']) + +env.Program( + target = 'vp-tris', + source = ['vp-tris.c'], + ) diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c index e1ddb2e14d..87cb12b984 100644 --- a/progs/vp/vp-tris.c +++ b/progs/vp/vp-tris.c @@ -9,25 +9,11 @@ #ifndef WIN32 #include #include -#define GL_GLEXT_PROTOTYPES -#else -#include #endif +#include #include -#ifdef WIN32 -static PFNGLBINDPROGRAMARBPROC glBindProgramARB = NULL; -static PFNGLGENPROGRAMSARBPROC glGenProgramsARB = NULL; -static PFNGLPROGRAMSTRINGARBPROC glProgramStringARB = NULL; -static PFNGLISPROGRAMARBPROC glIsProgramARB = NULL; - -static PFNGLBINDPROGRAMNVPROC glBindProgramNV = NULL; -static PFNGLGENPROGRAMSNVPROC glGenProgramsNV = NULL; -static PFNGLLOADPROGRAMNVPROC glLoadProgramNV = NULL; -static PFNGLISPROGRAMNVPROC glIsProgramNV = NULL; -#endif - static const char *filename = NULL; static GLuint nr_steps = 4; @@ -115,13 +101,6 @@ static void Init( void ) fprintf(stderr, "%.*s\n", sz, buf); if (strncmp( buf, "!!VP", 4 ) == 0) { -#ifdef WIN32 - glBindProgramNV = (PFNGLBINDPROGRAMNVPROC) wglGetProcAddress( "glBindProgramNV" ); - glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC) wglGetProcAddress( "glGenProgramsNV" ); - glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC) wglGetProcAddress( "glLoadProgramNV" ); - glIsProgramNV = (PFNGLISPROGRAMNVPROC) wglGetProcAddress( "glIsProgramNV" ); -#endif - glEnable( GL_VERTEX_PROGRAM_NV ); glGenProgramsNV( 1, &prognum ); glBindProgramNV( GL_VERTEX_PROGRAM_NV, prognum ); @@ -129,13 +108,6 @@ static void Init( void ) assert( glIsProgramNV( prognum ) ); } else { -#ifdef WIN32 - glBindProgramARB = (PFNGLBINDPROGRAMARBPROC) wglGetProcAddress( "glBindProgramARB" ); - glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC) wglGetProcAddress( "glGenProgramsARB" ); - glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC) wglGetProcAddress( "glProgramStringARB" ); - glIsProgramARB = (PFNGLISPROGRAMARBPROC) wglGetProcAddress( "glIsProgramARB" ); -#endif - glEnable(GL_VERTEX_PROGRAM_ARB); glGenProgramsARB(1, &prognum); @@ -288,6 +260,7 @@ int main( int argc, char *argv[] ) glutInitWindowSize( 250, 250 ); glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH ); glutCreateWindow(argv[argc-1]); + glewInit(); glutReshapeFunc( Reshape ); glutKeyboardFunc( Key ); glutDisplayFunc( Display ); -- cgit v1.2.3