progs: Build samples dir with scons and glew.
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
SConscript([
|
SConscript([
|
||||||
'util/SConscript',
|
'util/SConscript',
|
||||||
'demos/SConscript',
|
'demos/SConscript',
|
||||||
'trivial/SConscript',
|
|
||||||
'redbook/SConscript',
|
'redbook/SConscript',
|
||||||
|
'samples/SConscript',
|
||||||
|
'trivial/SConscript',
|
||||||
'vp/SConscript',
|
'vp/SConscript',
|
||||||
])
|
])
|
||||||
|
@@ -7,7 +7,7 @@ INCDIR = $(TOP)/include
|
|||||||
|
|
||||||
LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
|
LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
PROGS = accum bitmap1 bitmap2 blendeq blendxor copy cursor depth eval fog \
|
PROGS = accum bitmap1 bitmap2 blendeq blendxor copy cursor depth eval fog \
|
||||||
font line logo nurb olympic overlay point prim quad select \
|
font line logo nurb olympic overlay point prim quad select \
|
||||||
|
58
progs/samples/SConscript
Normal file
58
progs/samples/SConscript
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
Import('*')
|
||||||
|
|
||||||
|
if not env['GLUT']:
|
||||||
|
Return()
|
||||||
|
|
||||||
|
env = env.Clone()
|
||||||
|
|
||||||
|
env.Prepend(CPPPATH = [
|
||||||
|
'../util',
|
||||||
|
])
|
||||||
|
|
||||||
|
env.Prepend(LIBS = [
|
||||||
|
util,
|
||||||
|
'$GLUT_LIB'
|
||||||
|
])
|
||||||
|
|
||||||
|
if env['platform'] == 'windows':
|
||||||
|
env.Append(CPPDEFINES = ['NOMINMAX'])
|
||||||
|
env.Prepend(LIBS = ['winmm'])
|
||||||
|
|
||||||
|
progs = [
|
||||||
|
'accum',
|
||||||
|
'bitmap1',
|
||||||
|
'bitmap2',
|
||||||
|
'blendeq',
|
||||||
|
'blendxor',
|
||||||
|
'copy',
|
||||||
|
'cursor',
|
||||||
|
'depth',
|
||||||
|
'eval',
|
||||||
|
'fog',
|
||||||
|
'font',
|
||||||
|
'line',
|
||||||
|
'logo',
|
||||||
|
'nurb',
|
||||||
|
#'oglinfo',
|
||||||
|
'olympic',
|
||||||
|
'overlay',
|
||||||
|
'point',
|
||||||
|
'prim',
|
||||||
|
'quad',
|
||||||
|
'rgbtoppm',
|
||||||
|
'select',
|
||||||
|
'shape',
|
||||||
|
'sphere',
|
||||||
|
'star',
|
||||||
|
'stencil',
|
||||||
|
'stretch',
|
||||||
|
'texture',
|
||||||
|
'tri',
|
||||||
|
'wave',
|
||||||
|
]
|
||||||
|
|
||||||
|
for prog in progs:
|
||||||
|
env.Program(
|
||||||
|
target = prog,
|
||||||
|
source = prog + '.c',
|
||||||
|
)
|
@@ -11,10 +11,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef _WIN32
|
#include <GL/glew.h>
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
#define GL_GLEXT_PROTOTYPES
|
|
||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
|
|
||||||
GLenum doubleBuffer;
|
GLenum doubleBuffer;
|
||||||
@@ -274,6 +271,8 @@ int main(int argc, char **argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glewInit();
|
||||||
|
|
||||||
/* Make sure blend_logic_op extension is there. */
|
/* Make sure blend_logic_op extension is there. */
|
||||||
s = (char *) glGetString(GL_EXTENSIONS);
|
s = (char *) glGetString(GL_EXTENSIONS);
|
||||||
version = (char*) glGetString(GL_VERSION);
|
version = (char*) glGetString(GL_VERSION);
|
||||||
|
@@ -10,13 +10,8 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifdef _WIN32
|
#include <GL/glew.h>
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
#define GL_GLEXT_LEGACY
|
|
||||||
#define GL_GLEXT_PROTOTYPES
|
|
||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
#include <GL/glext.h>
|
|
||||||
|
|
||||||
|
|
||||||
GLenum doubleBuffer;
|
GLenum doubleBuffer;
|
||||||
@@ -176,6 +171,8 @@ int main(int argc, char **argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glewInit();
|
||||||
|
|
||||||
/* Make sure blend_logic_op extension is there. */
|
/* Make sure blend_logic_op extension is there. */
|
||||||
s = (char *) glGetString(GL_EXTENSIONS);
|
s = (char *) glGetString(GL_EXTENSIONS);
|
||||||
version = (char*) glGetString(GL_VERSION);
|
version = (char*) glGetString(GL_VERSION);
|
||||||
|
Reference in New Issue
Block a user