Commit 56a51867 authored by Daniel Burke's avatar Daniel Burke

ifndef APPLE for the Glew initialisation

parent 4247adbc
......@@ -310,6 +310,7 @@ int main( int argc, char **argv )
glutDisplayFunc( display );
glutKeyboardFunc( keyboard );
#ifndef __APPLE__
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (GLEW_OK != err)
......@@ -319,6 +320,7 @@ int main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
buffer = text_buffer_new( LCD_FILTERING_OFF );
vec4 black = {{0.0, 0.0, 0.0, 1.0}};
......
......@@ -217,7 +217,7 @@ int main( int argc, char **argv )
glutDisplayFunc( display );
glutKeyboardFunc( keyboard );
glutIdleFunc( idle );
#ifndef __APPLE__
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (GLEW_OK != err)
......@@ -227,7 +227,7 @@ int main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
atlas = texture_atlas_new( 512, 512, 1 );
font = texture_font_new_from_file( atlas, 12, "fonts/VeraMono.ttf" );
buffer = vertex_buffer_new( "vertex:3f,tex_coord:2f,color:4f" );
......
......@@ -159,7 +159,7 @@ int main( int argc, char **argv )
glutReshapeFunc( reshape );
glutDisplayFunc( display );
glutKeyboardFunc( keyboard );
#ifndef __APPLE__
GLenum err = glewInit();
if (GLEW_OK != err)
{
......@@ -168,7 +168,7 @@ int main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
atlas = texture_atlas_new( 1024, 1024, 1 );
buffer = vertex_buffer_new( "vertex:3f,tex_coord:2f,color:4f" );
texture_font_t *font =
......
......@@ -704,7 +704,7 @@ main( int argc, char **argv )
glutKeyboardFunc( on_key_press );
glutSpecialFunc( on_special_key_press );
glutReshapeWindow( 600,400 );
#ifndef __APPLE__
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (GLEW_OK != err)
......@@ -714,7 +714,7 @@ main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
console = console_new();
console_print( console,
L"OpenGL Freetype console\n"
......
......@@ -149,7 +149,7 @@ int main( int argc, char **argv )
glutKeyboardFunc( keyboard );
//glutTimerFunc( 1000/60, timer, 1000/60 ); // not working on some systems (bug in GLUT)
glutIdleFunc(display);
#ifndef __APPLE__
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (GLEW_OK != err)
......@@ -159,7 +159,7 @@ int main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
typedef struct { float x,y,z;} xyz;
typedef struct { float r,g,b,a;} rgba;
......
......@@ -271,7 +271,7 @@ main( int argc, char **argv )
glutReshapeFunc( reshape );
glutDisplayFunc( display );
glutKeyboardFunc( keyboard );
#ifndef __APPLE__
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (GLEW_OK != err)
......@@ -281,7 +281,7 @@ main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
texture_font_t *font = 0;
texture_atlas_t *atlas = texture_atlas_new( 512, 512, 1 );
const char * filename = "fonts/Vera.ttf";
......
......@@ -430,7 +430,7 @@ main( int argc, char **argv )
glutDisplayFunc( display );
glutKeyboardFunc( keyboard );
glutTimerFunc( 1000.0/60, timer, 60 );
#ifndef __APPLE__
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (GLEW_OK != err)
......@@ -440,7 +440,7 @@ main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
program = shader_load( "shaders/distance-field.vert",
"shaders/distance-field-3.frag" );
glUseProgram( program );
......
......@@ -255,7 +255,7 @@ main( int argc, char **argv )
glutMotionFunc( mouse_drag );
glutPassiveMotionFunc( mouse_motion );
glutKeyboardFunc( keyboard );
#ifndef __APPLE__
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (GLEW_OK != err)
......@@ -265,7 +265,7 @@ main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
unsigned char *map;
texture_font_t * font;
......
......@@ -155,7 +155,7 @@ int main( int argc, char **argv )
glutReshapeFunc( reshape );
glutDisplayFunc( display );
glutKeyboardFunc( keyboard );
#ifndef __APPLE__
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (GLEW_OK != err)
......@@ -165,7 +165,7 @@ int main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
size_t i;
texture_font_t *font = 0;
texture_atlas_t *atlas = texture_atlas_new( 512, 512, 1 );
......
......@@ -128,7 +128,7 @@ int main( int argc, char **argv )
glutReshapeFunc( reshape );
glutDisplayFunc( display );
glutKeyboardFunc( keyboard );
#ifndef __APPLE__
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (GLEW_OK != err)
......@@ -138,7 +138,7 @@ int main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
buffer = text_buffer_new( LCD_FILTERING_OFF );
vec4 white = {{1.0, 1.0, 1.0, 1.0}};
vec4 black = {{0.0, 0.0, 0.0, 1.0}};
......
......@@ -185,7 +185,7 @@ int main( int argc, char **argv )
glutReshapeFunc( reshape );
glutDisplayFunc( display );
glutKeyboardFunc( keyboard );
#ifndef __APPLE__
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (GLEW_OK != err)
......@@ -195,7 +195,7 @@ int main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
vec4 blue = {{0,0,1,1}};
vec4 black = {{0,0,0,1}};
......
......@@ -172,7 +172,7 @@ int main( int argc, char **argv )
glutReshapeFunc( reshape );
glutDisplayFunc( display );
glutKeyboardFunc( keyboard );
#ifndef __APPLE__
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (GLEW_OK != err)
......@@ -182,7 +182,7 @@ int main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
size_t i;
texture_font_t *font = 0;
atlas = texture_atlas_new( 512, 512, 3 );
......
......@@ -169,7 +169,7 @@ int main( int argc, char **argv )
glutReshapeFunc( reshape );
glutDisplayFunc( display );
glutKeyboardFunc( keyboard );
#ifndef __APPLE__
GLenum err = glewInit();
if (GLEW_OK != err)
{
......@@ -178,7 +178,7 @@ int main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
buffer = text_buffer_new( LCD_FILTERING_ON );
vec4 black = {{0.0, 0.0, 0.0, 1.0}};
......
......@@ -191,7 +191,7 @@ int main( int argc, char **argv )
glutReshapeFunc( reshape );
glutDisplayFunc( display );
glutKeyboardFunc( keyboard );
#ifndef __APPLE__
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (GLEW_OK != err)
......@@ -201,7 +201,7 @@ int main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
atlas = texture_atlas_new( 512, 512, 1 );
buffer = vertex_buffer_new( "vertex:3f,tex_coord:2f,color:4f" );
......
......@@ -138,7 +138,7 @@ int main( int argc, char **argv )
glutReshapeFunc( reshape );
glutDisplayFunc( display );
glutKeyboardFunc( keyboard );
#ifndef __APPLE__
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (GLEW_OK != err)
......@@ -148,7 +148,7 @@ int main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
buffer = vertex_buffer_new( "vertex:3f,color:4f" );
vertex_t vertices[4*2] = { { 15, 0,0, 0,0,0,1},
{ 15,330,0, 0,0,0,1},
......
......@@ -105,7 +105,7 @@ int main( int argc, char **argv )
glutReshapeFunc( reshape );
glutDisplayFunc( display );
glutKeyboardFunc( keyboard );
#ifndef __APPLE__
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (GLEW_OK != err)
......@@ -115,7 +115,7 @@ int main( int argc, char **argv )
exit( EXIT_FAILURE );
}
fprintf( stderr, "Using GLEW %s\n", glewGetString(GLEW_VERSION) );
#endif
texture_atlas_t * atlas = texture_atlas_new( 512, 512, 1 );
const char *filename = "fonts/Vera.ttf";
const wchar_t *cache = L" !\"#$%&'()*+,-./0123456789:;<=>?"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment