src/fg_input_devices.c
src/fg_joystick.c
src/fg_main.c
+ src/fg_main.h
src/fg_misc.c
src/fg_overlay.c
src/fg_spaceball.c
ELSEIF(ANDROID)
LIST(APPEND FREEGLUT_SRCS
- src/egl/fg_internal_egl.h
- src/egl/fg_display_egl.c
- src/egl/fg_ext_egl.c
- src/egl/fg_init_egl.c
- src/egl/fg_state_egl.c
- src/egl/fg_structure_egl.c
- src/egl/fg_structure_egl.h
- src/egl/fg_window_egl.c
- src/egl/fg_window_egl.h
src/android/native_app_glue/android_native_app_glue.c
src/android/native_app_glue/android_native_app_glue.h
src/android/fg_internal_android.h
src/android/fg_input_devices_android.c
src/android/fg_joystick_android.c
src/android/fg_main_android.c
+ src/android/fg_main_android.h
src/android/fg_runtime_android.c
src/android/fg_spaceball_android.c
src/android/fg_state_android.c
src/x11/fg_window_x11.c
src/x11/fg_xinput_x11.c
)
- IF(FREEGLUT_GLES2 OR FREEGLUT_GLES1)
- LIST(APPEND FREEGLUT_SRCS
- src/egl/fg_internal_egl.h
- src/egl/fg_display_egl.c
- src/egl/fg_ext_egl.c
- src/egl/fg_init_egl.c
- src/egl/fg_state_egl.c
- src/egl/fg_structure_egl.c
- src/egl/fg_window_egl.c
- )
- ELSE()
+ IF(!(FREEGLUT_GLES2 OR FREEGLUT_GLES1))
LIST(APPEND FREEGLUT_SRCS
src/x11/fg_internal_x11_glx.h
src/x11/fg_display_x11_glx.c
)
ENDIF()
ENDIF()
+IF(FREEGLUT_GLES2 OR FREEGLUT_GLES1)
+ LIST(APPEND FREEGLUT_SRCS
+ src/egl/fg_internal_egl.h
+ src/egl/fg_display_egl.c
+ src/egl/fg_ext_egl.c
+ src/egl/fg_init_egl.c
+ src/egl/fg_init_egl.h
+ src/egl/fg_state_egl.c
+ src/egl/fg_state_egl.h
+ src/egl/fg_structure_egl.c
+ src/egl/fg_structure_egl.h
+ src/egl/fg_window_egl.c
+ src/egl/fg_window_egl.h
+ )
+ENDIF()
# For OpenGL ES (GLES):
# - compile with -DFREEGLUT_GLES1 and -DFREEGLUT_GLES2 to cleanly
cmake_minimum_required(VERSION 2.6)
project(test-shapes-gles1)
+IF(CMAKE_COMPILER_IS_GNUCC)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
+ IF(!ANDROID)
+ # not setting -ansi as EGL/KHR headers doesn't support it
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi")
+ ENDIF()
+ENDIF(CMAKE_COMPILER_IS_GNUCC)
+
# FreeGLUT
include(FindPkgConfig)
pkg_check_modules(freeglut REQUIRED freeglut-gles1>=3.0.0)
/*
- * freeglut_gamemode_x11.c
+ * fg_gamemode_x11.c
*
* The game mode handling code.
*
/*
- * freeglut_init_android.c
+ * fg_init_android.c
*
* Various freeglut initialization functions.
*
#include <GL/freeglut.h>
#include "fg_internal.h"
+#include "egl/fg_init_egl.h"
void fgPlatformInitialize()
{
/*
- * freeglut_input_devices_android.c
+ * fg_input_devices_android.c
*
* Handles miscellaneous input devices via direct serial-port access.
*
/*
- * freeglut_internal_android.h
+ * fg_internal_android.h
*
* The freeglut library private include file.
*
typedef struct tagSFG_PlatformWindowState SFG_PlatformWindowState;
struct tagSFG_PlatformWindowState
{
+ int unused;
};
#endif /* FREEGLUT_INTERNAL_ANDROID_H */
/*
- * freeglut_joystick_android.c
+ * fg_joystick_android.c
*
* Joystick handling code
*
/*
- * freeglut_main_android.c
+ * fg_main_android.c
*
* The Android-specific windows message processing methods.
*
#include <GL/freeglut.h>
#include "fg_internal.h"
+#include "fg_main.h"
#include <android/log.h>
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "FreeGLUT", __VA_ARGS__))
LOGI("motion %.01f,%.01f action=%d", x, y, AMotionEvent_getAction(event));
/* Virtual arrows PAD */
- // Don't interfere with existing mouse move event
+ /* Don't interfere with existing mouse move event */
if (!touchscreen.in_mmotion) {
struct vpad_state prev_vpad = touchscreen.vpad;
touchscreen.vpad.left = touchscreen.vpad.right
= touchscreen.vpad.up = touchscreen.vpad.down = false;
- int32_t width = ANativeWindow_getWidth(window->Window.Handle);
+ /* int32_t width = ANativeWindow_getWidth(window->Window.Handle); */
int32_t height = ANativeWindow_getHeight(window->Window.Handle);
if (action == AMOTION_EVENT_ACTION_DOWN || action == AMOTION_EVENT_ACTION_MOVE) {
if ((x > 0 && x < 100) && (y > (height - 100) && y < height))
if (!touchscreen.vpad.on) {
window->State.MouseX = x;
window->State.MouseY = y;
- LOGI("Changed mouse position: %d,%d", x, y);
+ LOGI("Changed mouse position: %f,%f", x, y);
if (action == AMOTION_EVENT_ACTION_DOWN && FETCH_WCB(*window, Mouse)) {
touchscreen.in_mmotion = true;
INVOKE_WCB(*window, Mouse, (GLUT_LEFT_BUTTON, GLUT_DOWN, x, y));
--- /dev/null
+/*
+ * fg_main_android.h
+ *
+ * The Android-specific windows message processing methods.
+ *
+ * Copyright (C) 2012 Sylvain Beucler
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __FG_MAIN_ANDROID_H__
+#define __FG_MAIN_ANDROID_H__
+
+extern void fgPlatformProcessSingleEvent(void);
+extern void fgPlatformReshapeWindow(SFG_Window *window, int width, int height);
+extern void fgPlatformDisplayWindow(SFG_Window *window);
+extern unsigned long fgPlatformSystemTime(void);
+extern void fgPlatformSleepForEvents(long msec);
+extern void fgPlatformMainLoopPreliminaryWork(void);
+extern void fgPlatformDeinitialiseInputDevices(void);
+
+#endif
/*
- * freeglut_runtime_android.c
+ * fg_runtime_android.c
*
* Android runtime
*
static void onNativeWindowRedrawNeeded(ANativeActivity* activity, ANativeWindow* window) {
LOGI("onNativeWindowRedrawNeeded: %p\n", (void*)activity);
struct android_app* app = (struct android_app*)activity->instance;
- //if (fgDisplay.pDisplay.single_window->Window.pContext.eglSurface != EGL_NO_SURFACE)
android_app_write_cmd(app, APP_CMD_WINDOW_RESIZED);
}
void android_main(struct android_app* app) {
LOGI("android_main");
- // Register window resize callback
+ /* Register window resize callback */
app->activity->callbacks->onNativeWindowResized = onNativeWindowResized;
app->activity->callbacks->onContentRectChanged = onContentRectChanged;
app->activity->callbacks->onNativeWindowRedrawNeeded = onNativeWindowRedrawNeeded;
/*
- * freeglut_spaceball_android.c
+ * fg_spaceball_android.c
*
* Spaceball support for Windows
*
/*
- * freeglut_state_android.c
+ * fg_state_android.c
*
* Android-specific freeglut state query methods.
*
#include <stdio.h>
#include <android/native_window.h>
#include "fg_internal.h"
+#include "egl/fg_state_egl.h"
int fgPlatformGlutDeviceGet ( GLenum eWhat )
{
/*
- * freeglut_window_android.c
+ * fg_window_android.c
*
* Window management methods for Android
*
#include <GL/freeglut.h>
#include "fg_internal.h"
#include "egl/fg_window_egl.h"
+#include "android/fg_main_android.h"
/*
* Opens a window. Requires a SFG_Window object created and attached
GLboolean sizeUse, int w, int h,
GLboolean gameMode, GLboolean isSubWindow )
{
- // printf("fgPlatformOpenWindow %p ID=%d\n", (void*)window, window->ID);
-
/* TODO: only one full-screen window possible? */
static int nb_windows = 0;
if (nb_windows == 0) {
nb_windows++;
fgDisplay.pDisplay.single_window = window;
- // printf("=> %p ID=%d\n", (void*)fgDisplay.pDisplay.single_window, fgDisplay.pDisplay.single_window->ID);
} else {
return;
}
*/
extern void android_main(struct android_app* app);
+/* static */void android_app_write_cmd(struct android_app* android_app, int8_t cmd);
+
#ifdef __cplusplus
}
#endif
SFG_Proc fgPlatformGetProcAddress( const char *procName )
{
- return (SFG_Proc)eglGetProcAddress( ( const GLubyte * )procName );
+ return (SFG_Proc)eglGetProcAddress(procName);
}
/*
- * freeglut_init_egl.c
+ * fg_init_egl.c
*
* Various freeglut initialization functions.
*
eglBindAPI(EGL_OPENGL_ES_API);
# endif
- // fgDisplay.ScreenWidth = ...;
- // fgDisplay.ScreenHeight = ...;
- // fgDisplay.ScreenWidthMM = ...;
- // fgDisplay.ScreenHeightMM = ...;
+ /* fgDisplay.ScreenWidth = ...; */
+ /* fgDisplay.ScreenHeight = ...; */
+ /* fgDisplay.ScreenWidthMM = ...; */
+ /* fgDisplay.ScreenHeightMM = ...; */
}
void fghPlatformCloseDisplayEGL()
--- /dev/null
+/*
+ * fg_init_egl.h
+ *
+ * Various freeglut initialization functions.
+ *
+ * Copyright (C) 2012 Sylvain Beucler
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __FG_INIT_EGL_H__
+#define __FG_INIT_EGL_H__
+
+extern void fghPlatformInitializeEGL();
+extern void fghPlatformCloseDisplayEGL();
+extern void fgPlatformDestroyContext();
+
+#endif
#include <GL/freeglut.h>
#include "fg_internal.h"
+#include "egl/fg_window_egl.h"
/*
* Queries the GL context about some attributes
attribute_name = EGL_SAMPLES;
EGLConfig* configArray;
- EGLConfig* config;
EGLint configArraySize = 0;
/* Get number of available configs */
/* We get results in ascending order */
{
- int * temp_array;
- int previous_value;
+ int previous_value = 0;
int i;
array = malloc(sizeof(int) * configArraySize);
- previous_value = 0;
for (i = 0; i < configArraySize; i++) {
- int value;
+ int value = 0;
eglGetConfigAttrib(fgDisplay.pDisplay.egl.Display,
configArray[i], attribute_name, &value);
if (value > previous_value)
{
previous_value = value;
- temp_array[*size] = value;
+ array[*size] = value;
(*size)++;
}
}
--- /dev/null
+/*
+ * fg_state_egl.c
+ *
+ * EGL-specific freeglut state query methods.
+ *
+ * Copyright (C) 2012 Sylvain Beucler
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __FG_STATE_EGL_H__
+#define __FG_STATE_EGL_H__
+
+#include <GL/freeglut.h>
+#include "fg_internal.h"
+int fghPlatformGlutGetEGL(GLenum eWhat);
+
+#endif
fgPlatformSetWindow(window);
- //EGLint w, h;
- //eglQuerySurface(display, surface, EGL_WIDTH, &w);
- //eglQuerySurface(display, surface, EGL_HEIGHT, &h);
+ /* EGLint w, h; */
+ /* eglQuerySurface(display, surface, EGL_WIDTH, &w); */
+ /* eglQuerySurface(display, surface, EGL_HEIGHT, &h); */
}
/*
- * freeglut_display_android.c
+ * fg_window_egl.h
*
* Window management methods for EGL
*
fghEnableVertexAttribArray(attribute_v_coord);
fghBindBuffer(FGH_ARRAY_BUFFER, vbo_coords);
fghVertexAttribPointer(
- attribute_v_coord, // attribute
- 3, // number of elements per vertex, here (x,y,z)
- GL_FLOAT, // the type of each element
- GL_FALSE, // take our values as-is
- 0, // no extra data between each position
- 0 // offset of first element
+ attribute_v_coord, /* attribute */
+ 3, /* number of elements per vertex, here (x,y,z) */
+ GL_FLOAT, /* the type of each element */
+ GL_FALSE, /* take our values as-is */
+ 0, /* no extra data between each position */
+ 0 /* offset of first element */
);
}
fghEnableVertexAttribArray(attribute_v_normal);
fghBindBuffer(FGH_ARRAY_BUFFER, vbo_normals);
fghVertexAttribPointer(
- attribute_v_normal, // attribute
- 3, // number of elements per vertex, here (x,y,z)
- GL_FLOAT, // the type of each element
- GL_FALSE, // take our values as-is
- 0, // no extra data between each position
- 0 // offset of first element
+ attribute_v_normal, /* attribute */
+ 3, /* number of elements per vertex, here (x,y,z) */
+ GL_FLOAT, /* the type of each element */
+ GL_FALSE, /* take our values as-is */
+ 0, /* no extra data between each position */
+ 0 /* offset of first element */
);
}
fghEnableVertexAttribArray(attribute_v_coord);
fghBindBuffer(FGH_ARRAY_BUFFER, vbo_coords);
fghVertexAttribPointer(
- attribute_v_coord, // attribute
- 3, // number of elements per vertex, here (x,y,z)
- GL_FLOAT, // the type of each element
- GL_FALSE, // take our values as-is
- 0, // no extra data between each position
- 0 // offset of first element
+ attribute_v_coord, /* attribute */
+ 3, /* number of elements per vertex, here (x,y,z) */
+ GL_FLOAT, /* the type of each element */
+ GL_FALSE, /* take our values as-is */
+ 0, /* no extra data between each position */
+ 0 /* offset of first element */
);
};
fghEnableVertexAttribArray(attribute_v_normal);
fghBindBuffer(FGH_ARRAY_BUFFER, vbo_normals);
fghVertexAttribPointer(
- attribute_v_normal, // attribute
- 3, // number of elements per vertex, here (x,y,z)
- GL_FLOAT, // the type of each element
- GL_FALSE, // take our values as-is
- 0, // no extra data between each position
- 0 // offset of first element
+ attribute_v_normal, /* attribute */
+ 3, /* number of elements per vertex, here (x,y,z) */
+ GL_FLOAT, /* the type of each element */
+ GL_FALSE, /* take our values as-is */
+ 0, /* no extra data between each position */
+ 0 /* offset of first element */
);
};
for (i=0; i<numFaces; i++)
{
int normIdx = i*3;
- int faceIdxVertIdx = i*numEdgePerFace; // index to first element of "row" in vertex indices
+ int faceIdxVertIdx = i*numEdgePerFace; /* index to first element of "row" in vertex indices */
for (j=0; j<numEdgePerFace; j++)
{
int outIdx = i*numEdgePerFace*3+j*3;
7,4,3,2,
4,7,6,5
};
-DECLARE_SHAPE_CACHE_DECOMPOSE_TO_TRIANGLE(cube,Cube,CUBE);
+DECLARE_SHAPE_CACHE_DECOMPOSE_TO_TRIANGLE(cube,Cube,CUBE)
/* -- Dodecahedron -- */
/* Magic Numbers: It is possible to create a dodecahedron by attaching two
18, 1, 0, 5, 9,
19, 14, 13, 10, 12
};
-DECLARE_SHAPE_CACHE_DECOMPOSE_TO_TRIANGLE(dodecahedron,Dodecahedron,DODECAHEDRON);
+DECLARE_SHAPE_CACHE_DECOMPOSE_TO_TRIANGLE(dodecahedron,Dodecahedron,DODECAHEDRON)
/* -- Icosahedron -- */
11, 6, 7 ,
11, 10, 6
};
-DECLARE_SHAPE_CACHE(icosahedron,Icosahedron,ICOSAHEDRON);
+DECLARE_SHAPE_CACHE(icosahedron,Icosahedron,ICOSAHEDRON)
/* -- Octahedron -- */
#define OCTAHEDRON_NUM_VERT 6
3, 4, 2,
3, 5, 4
};
-DECLARE_SHAPE_CACHE(octahedron,Octahedron,OCTAHEDRON);
+DECLARE_SHAPE_CACHE(octahedron,Octahedron,OCTAHEDRON)
/* -- RhombicDodecahedron -- */
#define RHOMBICDODECAHEDRON_NUM_VERT 14
7, 11, 13, 12,
8, 12, 13, 9
};
-DECLARE_SHAPE_CACHE_DECOMPOSE_TO_TRIANGLE(rhombicdodecahedron,RhombicDodecahedron,RHOMBICDODECAHEDRON);
+DECLARE_SHAPE_CACHE_DECOMPOSE_TO_TRIANGLE(rhombicdodecahedron,RhombicDodecahedron,RHOMBICDODECAHEDRON)
/* -- Tetrahedron -- */
/* Magic Numbers: r0 = ( 1, 0, 0 )
0, 3, 1,
0, 1, 2
};
-DECLARE_SHAPE_CACHE(tetrahedron,Tetrahedron,TETRAHEDRON);
+DECLARE_SHAPE_CACHE(tetrahedron,Tetrahedron,TETRAHEDRON)
/* -- Sierpinski Sponge -- */
static unsigned int ipow (int x, unsigned int y)
}
}
+#ifndef GL_ES_VERSION_2_0
/* -- Now the various shapes involving circles -- */
/*
* Compute lookup table of cos and sin values forming a circle
free(sint2);
free(cost2);
}
-
+#endif
/* -- INTERNAL DRAWING functions --------------------------------------- */
#define _DECLARE_INTERNAL_DRAW_DO_DECLARE(name,nameICaps,nameCaps,vertIdxs)\
free(vertices);
}
-DECLARE_INTERNAL_DRAW_DECOMPOSED_TO_TRIANGLE(dodecahedron,Dodecahedron,DODECAHEDRON);
-DECLARE_INTERNAL_DRAW(icosahedron,Icosahedron,ICOSAHEDRON);
-DECLARE_INTERNAL_DRAW(octahedron,Octahedron,OCTAHEDRON);
-DECLARE_INTERNAL_DRAW_DECOMPOSED_TO_TRIANGLE(rhombicdodecahedron,RhombicDodecahedron,RHOMBICDODECAHEDRON);
-DECLARE_INTERNAL_DRAW(tetrahedron,Tetrahedron,TETRAHEDRON);
+DECLARE_INTERNAL_DRAW_DECOMPOSED_TO_TRIANGLE(dodecahedron,Dodecahedron,DODECAHEDRON)
+DECLARE_INTERNAL_DRAW(icosahedron,Icosahedron,ICOSAHEDRON)
+DECLARE_INTERNAL_DRAW(octahedron,Octahedron,OCTAHEDRON)
+DECLARE_INTERNAL_DRAW_DECOMPOSED_TO_TRIANGLE(rhombicdodecahedron,RhombicDodecahedron,RHOMBICDODECAHEDRON)
+DECLARE_INTERNAL_DRAW(tetrahedron,Tetrahedron,TETRAHEDRON)
static void fghSierpinskiSponge ( int numLevels, double offset[3], GLfloat scale, GLboolean useWireMode )
{
fghCube( (GLfloat)dSize, FALSE );
}
-DECLARE_SHAPE_INTERFACE(Dodecahedron);
-DECLARE_SHAPE_INTERFACE(Icosahedron);
-DECLARE_SHAPE_INTERFACE(Octahedron);
-DECLARE_SHAPE_INTERFACE(RhombicDodecahedron);
+DECLARE_SHAPE_INTERFACE(Dodecahedron)
+DECLARE_SHAPE_INTERFACE(Icosahedron)
+DECLARE_SHAPE_INTERFACE(Octahedron)
+DECLARE_SHAPE_INTERFACE(RhombicDodecahedron)
void FGAPIENTRY glutWireSierpinskiSponge ( int num_levels, double offset[3], double scale )
{
fghSierpinskiSponge ( num_levels, offset, (GLfloat)scale, FALSE );
}
-DECLARE_SHAPE_INTERFACE(Tetrahedron);
+DECLARE_SHAPE_INTERFACE(Tetrahedron)
/*** END OF FILE ***/
void fgInitGL2() {
#ifndef GL_ES_VERSION_2_0
fgState.HasOpenGL20 = 0;
- // TODO: Mesa returns a valid stub function, rather than NULL,
- // when we request a non-existent function
+ /* TODO: Mesa returns a valid stub function, rather than NULL,
+ when we request a non-existent function */
#define CHECK(func, a) if ((a) == NULL) { fgWarning("fgInitGL2: " func " is NULL"); return; }
CHECK("fghGenBuffers", fghGenBuffers = (FGH_PFNGLGENBUFFERSPROC)glutGetProcAddress("glGenBuffers"));
CHECK("fghDeleteBuffers", fghDeleteBuffers = (FGH_PFNGLDELETEBUFFERSPROC)glutGetProcAddress("glDeleteBuffers"));
--- /dev/null
+/*
+ * fg_main.h
+ *
+ * The windows message processing methods.
+ *
+ * Copyright (C) 2012 Sylvain Beucler
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __FG_MAIN_H__
+#define __FG_MAIN_H__
+
+#include <GL/freeglut.h>
+#include "fg_internal.h"
+
+extern void fghRedrawWindow(SFG_Window *window);
+
+#endif
return GL_FALSE;
}
-int glutCreateMenu( void (* callback)( int menu ) ) {}
+int glutCreateMenu( void (* callback)( int menu ) ) { return 0; }
void glutDestroyMenu( int menu ) {}
int glutGetMenu( void ) { return 0; }
void glutSetMenu( int menu ) {}
int glutBitmapLength( void* font, const unsigned char* string ) { return 0; }
int glutStrokeLength( void* font, const unsigned char* string ) { return 0; }
-void *glutGetMenuData( void ) {}
+void *glutGetMenuData( void ) { return NULL; }
void glutSetMenuData(void* data) {}
int glutBitmapHeight( void* font ) { return 0; }
* Make "freeglut" window handle and context types so that we don't need so
* much conditionally-compiled code later in the library.
*/
+#ifndef EGL_VERSION_1_0
typedef Window SFG_WindowHandleType ;
-#ifdef EGL_VERSION_1_0
-typedef EGLContext SFG_WindowContextType ;
-#else
typedef GLXContext SFG_WindowContextType ;
#endif
typedef struct tagSFG_PlatformContext SFG_PlatformContext;