Make it running under Linux.
This commit is contained in:
parent
44d5c8668a
commit
23b7c7dc14
|
@ -0,0 +1,67 @@
|
|||
# progs/slang/Makefile
|
||||
|
||||
TOP = ../..
|
||||
|
||||
include $(TOP)/configs/current
|
||||
|
||||
INCDIR = $(TOP)/include
|
||||
|
||||
LIB_DEP = $(LIB_DIR)/$(GL_LIB_NAME)
|
||||
|
||||
#
|
||||
# targets
|
||||
#
|
||||
|
||||
.PHONY: default tests clean
|
||||
|
||||
default: cltest sotest vstest
|
||||
|
||||
tests: default
|
||||
! ./sotest 2> /dev/null | (grep -e ^[*][*][*])
|
||||
! ./vstest 2> /dev/null | (grep -e ^[*][*][*])
|
||||
! ./cltest 2> /dev/null | (grep -e ^[*][*][*])
|
||||
|
||||
clean:
|
||||
rm -f cltest.o sotest.o vstest.o framework.o cltest sotest vstest
|
||||
|
||||
#
|
||||
# executables
|
||||
#
|
||||
|
||||
cltest: cltest.o framework.o $(LIB_DEP)
|
||||
$(CC) cltest.o framework.o $(APP_LIB_DEPS) -o cltest
|
||||
|
||||
sotest: sotest.o framework.o $(LIB_DEP)
|
||||
$(CC) sotest.o framework.o $(APP_LIB_DEPS) -o sotest
|
||||
|
||||
vstest: vstest.o framework.o $(LIB_DEP)
|
||||
$(CC) vstest.o framework.o $(APP_LIB_DEPS) -o vstest
|
||||
|
||||
#
|
||||
# objects
|
||||
#
|
||||
|
||||
framework.o: framework.c
|
||||
$(CC) -c -I$(INCDIR) framework.c -o framework.o
|
||||
|
||||
cltest.o: cltest.c
|
||||
$(CC) -c -I$(INCDIR) cltest.c -o cltest.o
|
||||
|
||||
sotest.o: sotest.c
|
||||
$(CC) -c -I$(INCDIR) sotest.c -o sotest.o
|
||||
|
||||
vstest.o: vstest.c
|
||||
$(CC) -c -I$(INCDIR) vstest.c -o vstest.o
|
||||
|
||||
#
|
||||
# sources
|
||||
#
|
||||
|
||||
framework.c: framework.h
|
||||
|
||||
cltest.c: framework.h
|
||||
|
||||
sotest.c: framework.h
|
||||
|
||||
vstest.c: framework.h
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
GLSL regression tests.
|
||||
|
||||
Type "make" to build all test apps.
|
||||
|
||||
Type "make tests" to build and run all test apps. If any
|
||||
error is detected, a line starting with *** is output.
|
||||
|
|
@ -76,8 +76,8 @@ static void load_test_file (const char *filename, struct PROGRAM **program)
|
|||
struct PROGRAM **currprog = program;
|
||||
FILE *f;
|
||||
char line[256];
|
||||
enum PROGRAM_LOAD_STATE pls;
|
||||
enum SHADER_LOAD_STATE sls;
|
||||
enum PROGRAM_LOAD_STATE pls = PLS_NONE;
|
||||
enum SHADER_LOAD_STATE sls = SLS_NONE;
|
||||
|
||||
f = fopen (filename, "r");
|
||||
if (f == NULL)
|
||||
|
@ -174,7 +174,7 @@ void RenderScene (void)
|
|||
exit (0);
|
||||
|
||||
code = program->vertex.code;
|
||||
glShaderSourceARB (vert, 1, &code, NULL);
|
||||
glShaderSourceARB (vert, 1, (const GLcharARB **) (&code), NULL);
|
||||
glCompileShaderARB (vert);
|
||||
CheckObjectStatus (vert);
|
||||
|
||||
|
|
|
@ -3,8 +3,10 @@
|
|||
/*
|
||||
* GL_ARB_multitexture
|
||||
*/
|
||||
#ifndef GL_ARB_multitexture
|
||||
PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB;
|
||||
PFNGLMULTITEXCOORD4FVARBPROC glMultiTexCoord4fvARB;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GL_ARB_shader_objects
|
||||
|
@ -65,8 +67,10 @@ void InitFramework (int *argc, char *argv[])
|
|||
glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||
glutCreateWindow (argv[0]);
|
||||
|
||||
#ifndef GL_ARB_multitexture
|
||||
GETPROCADDR(glClientActiveTextureARB, PFNGLCLIENTACTIVETEXTUREARBPROC);
|
||||
GETPROCADDR(glMultiTexCoord4fvARB, PFNGLMULTITEXCOORD4FVARBPROC);
|
||||
#endif
|
||||
|
||||
GETPROCADDR(glDeleteObjectARB, PFNGLDELETEOBJECTARBPROC);
|
||||
GETPROCADDR(glGetHandleARB, PFNGLGETHANDLEARBPROC);
|
||||
|
@ -100,9 +104,6 @@ void InitFramework (int *argc, char *argv[])
|
|||
|
||||
InitScene ();
|
||||
|
||||
/*glutReshapeFunc (Reshape);
|
||||
glutKeyboardFunc (Key);
|
||||
glutSpecialFunc (SpecialKey);*/
|
||||
glutDisplayFunc (Display);
|
||||
glutIdleFunc (Idle);
|
||||
glutMainLoop ();
|
||||
|
|
|
@ -6,9 +6,10 @@
|
|||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glut.h>
|
||||
|
@ -25,8 +26,10 @@
|
|||
/*
|
||||
* GL_ARB_multitexture
|
||||
*/
|
||||
#ifndef GL_ARB_multitexture
|
||||
extern PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB;
|
||||
extern PFNGLMULTITEXCOORD4FVARBPROC glMultiTexCoord4fvARB;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GL_ARB_shader_objects
|
||||
|
@ -68,12 +71,12 @@ extern PFNGLFOGCOORDPOINTEREXTPROC glFogCoordPointerEXT;
|
|||
extern PFNGLSECONDARYCOLOR3FVEXTPROC glSecondaryColor3fvEXT;
|
||||
extern PFNGLSECONDARYCOLORPOINTEREXTPROC glSecondaryColorPointerEXT;
|
||||
|
||||
void InitFramework (int *argc, char *argv[]);
|
||||
extern void InitFramework (int *argc, char *argv[]);
|
||||
|
||||
extern void InitScene (void);
|
||||
extern void RenderScene (void);
|
||||
|
||||
GLboolean CheckObjectStatus (GLhandleARB);
|
||||
extern GLboolean CheckObjectStatus (GLhandleARB);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -210,7 +210,7 @@ static void dl_end ()
|
|||
static void load_test_file (const char *filename)
|
||||
{
|
||||
FILE *f;
|
||||
long size;
|
||||
GLint size;
|
||||
char *code;
|
||||
GLint i;
|
||||
|
||||
|
@ -230,7 +230,7 @@ static void load_test_file (const char *filename)
|
|||
size = fread (code, 1, size, f);
|
||||
fclose (f);
|
||||
|
||||
glShaderSourceARB (vert, 1, &code, &size);
|
||||
glShaderSourceARB (vert, 1, (const GLcharARB **) (&code), &size);
|
||||
glCompileShaderARB (vert);
|
||||
if (!CheckObjectStatus (vert))
|
||||
exit (0);
|
||||
|
|
Loading…
Reference in New Issue