From f637722fa1c12759b981a4c8bc6b8c3493cde9fa Mon Sep 17 00:00:00 2001
From: Camilla Berglund
Date: Mon, 27 Aug 2012 02:40:26 +0200
Subject: [PATCH 01/16] Removed MinGW-w64 hack.
---
include/GL/glfw3.h | 6 ------
1 file changed, 6 deletions(-)
diff --git a/include/GL/glfw3.h b/include/GL/glfw3.h
index 050f0c30..5172da21 100644
--- a/include/GL/glfw3.h
+++ b/include/GL/glfw3.h
@@ -67,12 +67,6 @@ extern "C" {
#endif
#endif /* APIENTRY */
-/* TEMPORARY MinGW-w64 hacks.
- */
-#if __MINGW64__
- #define WINAPI
-#endif
-
/* The following three defines are here solely to make some Windows-based
* files happy. Theoretically we could include , but
* it has the major drawback of severely polluting our namespace.
From 2a8b2ccef4b8f15600a8a36c344c6078a84f31ae Mon Sep 17 00:00:00 2001
From: Camilla Berglund
Date: Mon, 27 Aug 2012 03:25:58 +0200
Subject: [PATCH 02/16] Split internal prototypes into APIs.
---
src/internal.h | 54 +++++++++++++++++++++++++++++++-------------------
1 file changed, 34 insertions(+), 20 deletions(-)
diff --git a/src/internal.h b/src/internal.h
index 9129b50c..8fe3b241 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -242,38 +242,41 @@ extern _GLFWlibrary _glfwLibrary;
//========================================================================
-// Prototypes for platform specific implementation functions
+// Prototypes for the platform API
+// This is the interface exposed by the platform-specific code for each
+// platform and is called by the shared code of the public API
+// It mirrors the public API except it uses objects instead of handles
//========================================================================
-// Init/terminate
+// Platform init and version
int _glfwPlatformInit(void);
int _glfwPlatformTerminate(void);
const char* _glfwPlatformGetVersionString(void);
-// Input
+// Input mode support
void _glfwPlatformEnableSystemKeys(_GLFWwindow* window);
void _glfwPlatformDisableSystemKeys(_GLFWwindow* window);
void _glfwPlatformSetCursorPos(_GLFWwindow* window, int x, int y);
void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode);
-// Fullscreen
+// Video mode support
GLFWvidmode* _glfwPlatformGetVideoModes(int* count);
void _glfwPlatformGetDesktopMode(GLFWvidmode* mode);
-// Gamma ramp
+// Gamma ramp support
void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp);
void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp);
-// Clipboard
+// Clipboard support
void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string);
const char* _glfwPlatformGetClipboardString(_GLFWwindow* window);
-// Joystick
+// Joystick input
int _glfwPlatformGetJoystickParam(int joy, int param);
int _glfwPlatformGetJoystickPos(int joy, float* pos, int numaxes);
int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons, int numbuttons);
-// Time
+// Time input
double _glfwPlatformGetTime(void);
void _glfwPlatformSetTime(double time);
@@ -286,7 +289,7 @@ void _glfwPlatformSetWindowPos(_GLFWwindow* window, int x, int y);
void _glfwPlatformIconifyWindow(_GLFWwindow* window);
void _glfwPlatformRestoreWindow(_GLFWwindow* window);
-// Event management
+// Event processing
void _glfwPlatformPollEvents(void);
void _glfwPlatformWaitEvents(void);
@@ -301,19 +304,12 @@ void _glfwPlatformCopyContext(_GLFWwindow* src, _GLFWwindow* dst, unsigned long
//========================================================================
-// Prototypes for platform independent internal functions
+// Prototypes for the event API
+// This is used by the platform-specific code to notify the shared code of
+// events that can be translated into state changes and/or callback calls,
+// instead of directly calling callbacks or modifying shared state
//========================================================================
-// Fullscren management (fullscreen.c)
-int _glfwCompareVideoModes(const GLFWvidmode* first, const GLFWvidmode* second);
-void _glfwSplitBPP(int bpp, int* red, int* green, int* blue);
-
-// Error handling (init.c)
-void _glfwSetError(int error, const char* format, ...);
-
-// Window management (window.c)
-void _glfwSetDefaultWindowHints(void);
-
// Window event notification (window.c)
void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean activated);
void _glfwInputWindowPos(_GLFWwindow* window, int x, int y);
@@ -330,6 +326,24 @@ void _glfwInputMouseClick(_GLFWwindow* window, int button, int action);
void _glfwInputCursorMotion(_GLFWwindow* window, int x, int y);
void _glfwInputCursorEnter(_GLFWwindow* window, int entered);
+
+//========================================================================
+// Prototypes for internal utility functions
+// These functions are shared code and may be used by any part of GLFW
+// Each platform may add its own utility functions, but those may only be
+// called by the platform-specific code
+//========================================================================
+
+// Fullscren management (fullscreen.c)
+int _glfwCompareVideoModes(const GLFWvidmode* first, const GLFWvidmode* second);
+void _glfwSplitBPP(int bpp, int* red, int* green, int* blue);
+
+// Error handling (init.c)
+void _glfwSetError(int error, const char* format, ...);
+
+// Window management (window.c)
+void _glfwSetDefaultWindowHints(void);
+
// OpenGL context helpers (opengl.c)
int _glfwStringInExtensionString(const char* string, const GLubyte* extensions);
const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
From 96963213343971959c94dc94d03b8b93e22730ac Mon Sep 17 00:00:00 2001
From: Camilla Berglund
Date: Mon, 27 Aug 2012 13:52:10 +0200
Subject: [PATCH 03/16] Fixed return value of glfwGetCurrentContext.
---
src/opengl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/opengl.c b/src/opengl.c
index 67c6f414..a23a5f34 100644
--- a/src/opengl.c
+++ b/src/opengl.c
@@ -509,7 +509,7 @@ GLFWAPI GLFWwindow glfwGetCurrentContext(void)
if (!_glfwInitialized)
{
_glfwSetError(GLFW_NOT_INITIALIZED, NULL);
- return GL_FALSE;
+ return NULL;
}
return _glfwLibrary.currentWindow;
From e10d935efe8f3da472c1db98f977378020a74a8b Mon Sep 17 00:00:00 2001
From: Camilla Berglund
Date: Tue, 28 Aug 2012 15:03:57 +0200
Subject: [PATCH 04/16] API tag and error message cleanup.
---
src/cocoa_clipboard.m | 4 ++--
src/cocoa_fullscreen.m | 2 +-
src/cocoa_gamma.c | 2 +-
src/cocoa_input.m | 2 +-
src/cocoa_joystick.m | 2 +-
src/cocoa_time.c | 2 +-
src/cocoa_window.m | 32 +++++++++++++++-----------------
src/win32_clipboard.c | 14 +++++++-------
src/win32_dllmain.c | 2 +-
src/win32_fullscreen.c | 2 +-
src/win32_gamma.c | 2 +-
src/win32_input.c | 2 +-
src/win32_joystick.c | 2 +-
src/win32_opengl.c | 40 +++++++++++++++++++---------------------
src/win32_time.c | 2 +-
src/win32_window.c | 14 +++++++-------
src/window.c | 5 ++---
src/x11_clipboard.c | 4 ++--
src/x11_fullscreen.c | 4 ++--
src/x11_gamma.c | 6 +++---
src/x11_init.c | 4 ++--
src/x11_input.c | 2 +-
src/x11_joystick.c | 2 +-
src/x11_keysym2unicode.c | 2 +-
src/x11_opengl.c | 33 ++++++++++++++-------------------
src/x11_time.c | 2 +-
src/x11_window.c | 7 +++----
27 files changed, 93 insertions(+), 104 deletions(-)
diff --git a/src/cocoa_clipboard.m b/src/cocoa_clipboard.m
index 56b98437..99918f77 100644
--- a/src/cocoa_clipboard.m
+++ b/src/cocoa_clipboard.m
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: Cocoa/NSOpenGL
+// Platform: Cocoa
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
@@ -70,7 +70,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
if (!object)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Cocoa/NSGL: Failed to retrieve object from pasteboard");
+ "Cocoa: Failed to retrieve object from pasteboard");
return NULL;
}
diff --git a/src/cocoa_fullscreen.m b/src/cocoa_fullscreen.m
index 9382993b..47f86739 100644
--- a/src/cocoa_fullscreen.m
+++ b/src/cocoa_fullscreen.m
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: Cocoa/NSOpenGL
+// Platform: Cocoa
// API Version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
diff --git a/src/cocoa_gamma.c b/src/cocoa_gamma.c
index 06904516..85d1e489 100644
--- a/src/cocoa_gamma.c
+++ b/src/cocoa_gamma.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: Cocoa/NSOpenGL
+// Platform: Cocoa
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
diff --git a/src/cocoa_input.m b/src/cocoa_input.m
index c2bb503c..11e1083b 100644
--- a/src/cocoa_input.m
+++ b/src/cocoa_input.m
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: Cocoa/NSOpenGL
+// Platform: Cocoa
// API Version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
diff --git a/src/cocoa_joystick.m b/src/cocoa_joystick.m
index f3e113b4..ff4ba958 100644
--- a/src/cocoa_joystick.m
+++ b/src/cocoa_joystick.m
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: Cocoa/NSOpenGL
+// Platform: Cocoa
// API Version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
diff --git a/src/cocoa_time.c b/src/cocoa_time.c
index 745b4239..d80dd147 100644
--- a/src/cocoa_time.c
+++ b/src/cocoa_time.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: Cocoa/NSOpenGL
+// Platform: Cocoa
// API Version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
diff --git a/src/cocoa_window.m b/src/cocoa_window.m
index aaaff289..5129a21f 100644
--- a/src/cocoa_window.m
+++ b/src/cocoa_window.m
@@ -674,8 +674,7 @@ static GLboolean createWindow(_GLFWwindow* window,
if (window->NS.object == nil)
{
- _glfwSetError(GLFW_PLATFORM_ERROR,
- "Cocoa/NSOpenGL: Failed to create window");
+ _glfwSetError(GLFW_PLATFORM_ERROR, "Cocoa: Failed to create window");
return GL_FALSE;
}
@@ -717,8 +716,8 @@ static GLboolean createContext(_GLFWwindow* window,
(wndconfig->glMajor == 3 && wndconfig->glMinor != 2))
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "Cocoa/NSOpenGL: The targeted version of Mac OS X does "
- "not support any OpenGL version above 2.1 except 3.2");
+ "NSOpenGL: The targeted version of Mac OS X does not "
+ "support any OpenGL version above 2.1 except 3.2");
return GL_FALSE;
}
@@ -727,8 +726,8 @@ static GLboolean createContext(_GLFWwindow* window,
if (!wndconfig->glForward)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "Cocoa/NSOpenGL: The targeted version of Mac OS X "
- "only supports OpenGL 3.2 contexts if they are "
+ "NSOpenGL: The targeted version of Mac OS X only "
+ "supports OpenGL 3.2 contexts if they are "
"forward-compatible");
return GL_FALSE;
}
@@ -736,8 +735,8 @@ static GLboolean createContext(_GLFWwindow* window,
if (wndconfig->glProfile != GLFW_OPENGL_CORE_PROFILE)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "Cocoa/NSOpenGL: The targeted version of Mac OS X "
- "only supports OpenGL 3.2 contexts if they use the "
+ "NSOpenGL: The targeted version of Mac OS X only "
+ "supports OpenGL 3.2 contexts if they use the "
"core profile");
return GL_FALSE;
}
@@ -747,8 +746,8 @@ static GLboolean createContext(_GLFWwindow* window,
if (wndconfig->glMajor > 2)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "Cocoa/NSOpenGL: The targeted version of Mac OS X does "
- "not support OpenGL version 3.0 or above");
+ "NSOpenGL: The targeted version of Mac OS X does not "
+ "support OpenGL version 3.0 or above");
return GL_FALSE;
}
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
@@ -757,8 +756,8 @@ static GLboolean createContext(_GLFWwindow* window,
if (wndconfig->glRobustness)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "Cocoa/NSOpenGL: Mac OS X does not support OpenGL "
- "robustness strategies");
+ "NSOpenGL: Mac OS X does not support OpenGL robustness "
+ "strategies");
return GL_FALSE;
}
@@ -821,7 +820,7 @@ static GLboolean createContext(_GLFWwindow* window,
if (window->NSGL.pixelFormat == nil)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Cocoa/NSOpenGL: Failed to create OpenGL pixel format");
+ "NSOpenGL: Failed to create OpenGL pixel format");
return GL_FALSE;
}
@@ -836,7 +835,7 @@ static GLboolean createContext(_GLFWwindow* window,
if (window->NSGL.context == nil)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Cocoa/NSOpenGL: Failed to create OpenGL context");
+ "NSOpenGL: Failed to create OpenGL context");
return GL_FALSE;
}
@@ -868,8 +867,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
if (_glfwLibrary.NS.delegate == nil)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Cocoa/NSOpenGL: Failed to create application "
- "delegate");
+ "Cocoa: Failed to create application delegate");
return GL_FALSE;
}
@@ -880,7 +878,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
if (window->NS.delegate == nil)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Cocoa/NSOpenGL: Failed to create window delegate");
+ "Cocoa: Failed to create window delegate");
return GL_FALSE;
}
diff --git a/src/win32_clipboard.c b/src/win32_clipboard.c
index ca31964d..22cdb8f6 100644
--- a/src/win32_clipboard.c
+++ b/src/win32_clipboard.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: Win32/WGL
+// Platform: Win32
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
@@ -53,7 +53,7 @@ void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)
if (!wideString)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Win32/WGL: Failed to convert clipboard string to "
+ "Win32: Failed to convert clipboard string to "
"wide string");
return;
}
@@ -66,7 +66,7 @@ void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)
free(wideString);
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Win32/WGL: Failed to allocate global handle for clipboard");
+ "Win32: Failed to allocate global handle for clipboard");
return;
}
@@ -79,7 +79,7 @@ void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string)
free(wideString);
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Win32/WGL: Failed to open clipboard");
+ "Win32: Failed to open clipboard");
return;
}
@@ -108,7 +108,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
if (!OpenClipboard(window->Win32.handle))
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Win32/WGL: Failed to open clipboard");
+ "Win32: Failed to open clipboard");
return NULL;
}
@@ -118,7 +118,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
CloseClipboard();
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Win32/WGL: Failed to retrieve clipboard data");
+ "Win32: Failed to retrieve clipboard data");
return NULL;
}
@@ -132,7 +132,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
if (!_glfwLibrary.Win32.clipboardString)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Win32/WGL: Failed to convert wide string to UTF-8");
+ "Win32: Failed to convert wide string to UTF-8");
return NULL;
}
diff --git a/src/win32_dllmain.c b/src/win32_dllmain.c
index 95258ccc..98f9ab2a 100644
--- a/src/win32_dllmain.c
+++ b/src/win32_dllmain.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: Win32/WGL
+// Platform: Win32
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
diff --git a/src/win32_fullscreen.c b/src/win32_fullscreen.c
index 3e28e30e..35d75054 100644
--- a/src/win32_fullscreen.c
+++ b/src/win32_fullscreen.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: Win32/WGL
+// Platform: Win32
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
diff --git a/src/win32_gamma.c b/src/win32_gamma.c
index 36fbd3a4..74958191 100644
--- a/src/win32_gamma.c
+++ b/src/win32_gamma.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: Win32/WGL
+// Platform: Win32
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
diff --git a/src/win32_input.c b/src/win32_input.c
index d3785aa3..a9195838 100644
--- a/src/win32_input.c
+++ b/src/win32_input.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: Win32/WGL
+// Platform: Win32
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
diff --git a/src/win32_joystick.c b/src/win32_joystick.c
index c27218db..fcc6b599 100644
--- a/src/win32_joystick.c
+++ b/src/win32_joystick.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: Win32/WGL
+// Platform: Win32
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
diff --git a/src/win32_opengl.c b/src/win32_opengl.c
index 2c676c91..bf684094 100644
--- a/src/win32_opengl.c
+++ b/src/win32_opengl.c
@@ -171,15 +171,14 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
if (!available)
{
- _glfwSetError(GLFW_OPENGL_UNAVAILABLE, "Win32/WGL: No pixel formats found");
+ _glfwSetError(GLFW_OPENGL_UNAVAILABLE, "WGL: No pixel formats found");
return NULL;
}
fbconfigs = (_GLFWfbconfig*) malloc(sizeof(_GLFWfbconfig) * available);
if (!fbconfigs)
{
- _glfwSetError(GLFW_OUT_OF_MEMORY,
- "Win32/WGL: Failed to allocate _GLFWfbconfig array");
+ _glfwSetError(GLFW_OUT_OF_MEMORY, NULL);
return NULL;
}
@@ -285,6 +284,9 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
if (*found == 0)
{
+ _glfwSetError(GLFW_PLATFORM_ERROR,
+ "Win32/WGL: No usable pixel formats found");
+
free(fbconfigs);
return NULL;
}
@@ -310,15 +312,15 @@ static GLboolean createContext(_GLFWwindow* window,
if (!DescribePixelFormat(window->WGL.DC, pixelFormat, sizeof(pfd), &pfd))
{
- _glfwSetError(GLFW_OPENGL_UNAVAILABLE,
- "Win32/WGL: Failed to retrieve PFD for selected pixel format");
+ _glfwSetError(GLFW_PLATFORM_ERROR,
+ "Win32: Failed to retrieve PFD for selected pixel format");
return GL_FALSE;
}
if (!SetPixelFormat(window->WGL.DC, pixelFormat, &pfd))
{
- _glfwSetError(GLFW_OPENGL_UNAVAILABLE,
- "Win32/WGL: Failed to set selected pixel format");
+ _glfwSetError(GLFW_PLATFORM_ERROR,
+ "Win32: Failed to set selected pixel format");
return GL_FALSE;
}
@@ -360,7 +362,7 @@ static GLboolean createContext(_GLFWwindow* window,
if (!window->WGL.ARB_create_context_profile)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "Win32/WGL: OpenGL profile requested but "
+ "WGL: OpenGL profile requested but "
"WGL_ARB_create_context_profile is unavailable");
return GL_FALSE;
}
@@ -369,7 +371,7 @@ static GLboolean createContext(_GLFWwindow* window,
!window->WGL.EXT_create_context_es2_profile)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "Win32/WGL: OpenGL ES 2.x profile requested but "
+ "WGL: OpenGL ES 2.x profile requested but "
"WGL_EXT_create_context_es2_profile is unavailable");
return GL_FALSE;
}
@@ -392,7 +394,7 @@ static GLboolean createContext(_GLFWwindow* window,
if (!window->WGL.ARB_create_context_robustness)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "Win32/WGL: An OpenGL robustness strategy was "
+ "WGL: An OpenGL robustness strategy was "
"requested but WGL_ARB_create_context_robustness "
"is unavailable");
return GL_FALSE;
@@ -415,7 +417,7 @@ static GLboolean createContext(_GLFWwindow* window,
if (!window->WGL.context)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "Win32/WGL: Failed to create OpenGL context");
+ "WGL: Failed to create OpenGL context");
return GL_FALSE;
}
}
@@ -425,7 +427,7 @@ static GLboolean createContext(_GLFWwindow* window,
if (!window->WGL.context)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Win32/WGL: Failed to create OpenGL context");
+ "WGL: Failed to create OpenGL context");
return GL_FALSE;
}
@@ -434,8 +436,8 @@ static GLboolean createContext(_GLFWwindow* window,
if (!wglShareLists(share, window->WGL.context))
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Win32/WGL: Failed to enable sharing with "
- "specified OpenGL context");
+ "WGL: Failed to enable sharing with specified "
+ "OpenGL context");
return GL_FALSE;
}
}
@@ -466,7 +468,7 @@ int _glfwCreateContext(_GLFWwindow* window,
if (!window->WGL.DC)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Win32/WGL: Failed to retrieve DC for window");
+ "Win32: Failed to retrieve DC for window");
return GL_FALSE;
}
@@ -478,16 +480,12 @@ int _glfwCreateContext(_GLFWwindow* window,
fbconfigs = getFBConfigs(window, &fbcount);
if (!fbconfigs)
- {
- _glfwSetError(GLFW_PLATFORM_ERROR,
- "Win32/WGL: No usable pixel formats found");
return GL_FALSE;
- }
result = _glfwChooseFBConfig(fbconfig, fbconfigs, fbcount);
if (!result)
{
- _glfwSetError(GLFW_PLATFORM_ERROR,
+ _glfwSetError(GLFW_FORMAT_UNAVAILABLE,
"Win32/WGL: No pixel format matched the criteria");
free(fbconfigs);
@@ -620,7 +618,7 @@ void _glfwPlatformCopyContext(_GLFWwindow* src, _GLFWwindow* dst, unsigned long
if (!wglCopyContext(src->WGL.context, dst->WGL.context, mask))
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Win32/WGL: Failed to copy OpenGL context attributes");
+ "WGL: Failed to copy OpenGL context attributes");
}
}
diff --git a/src/win32_time.c b/src/win32_time.c
index f3bd173a..1e1d57f4 100644
--- a/src/win32_time.c
+++ b/src/win32_time.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: Win32/WGL
+// Platform: Win32
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
diff --git a/src/win32_window.c b/src/win32_window.c
index 77b99026..feccb833 100644
--- a/src/win32_window.c
+++ b/src/win32_window.c
@@ -813,7 +813,7 @@ static ATOM registerWindowClass(void)
if (!classAtom)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "Win32/WGL: Failed to register window class");
+ "Win32: Failed to register window class");
return 0;
}
@@ -886,7 +886,7 @@ static int createWindow(_GLFWwindow* window,
if (!wideTitle)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "glfwCreateWindow: Failed to convert title to wide string");
+ "Win32: Failed to convert title to wide string");
return GL_FALSE;
}
@@ -904,7 +904,7 @@ static int createWindow(_GLFWwindow* window,
if (!window->Win32.handle)
{
- _glfwSetError(GLFW_PLATFORM_ERROR, "Win32/WGL: Failed to create window");
+ _glfwSetError(GLFW_PLATFORM_ERROR, "Win32: Failed to create window");
return GL_FALSE;
}
@@ -1008,8 +1008,8 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
if (!window->WGL.ARB_create_context)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "Win32/WGL: A forward compatible OpenGL context "
- "requested but WGL_ARB_create_context is unavailable");
+ "WGL: A forward compatible OpenGL context requested "
+ "but WGL_ARB_create_context is unavailable");
return GL_FALSE;
}
@@ -1021,7 +1021,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
if (!window->WGL.ARB_create_context_profile)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "Win32/WGL: OpenGL profile requested but "
+ "WGL: OpenGL profile requested but "
"WGL_ARB_create_context_profile is unavailable");
return GL_FALSE;
}
@@ -1107,7 +1107,7 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
if (!wideTitle)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "glfwSetWindowTitle: Failed to convert title to wide string");
+ "Win32: Failed to convert title to wide string");
return;
}
diff --git a/src/window.c b/src/window.c
index 4e95129a..acd48195 100644
--- a/src/window.c
+++ b/src/window.c
@@ -267,7 +267,7 @@ GLFWAPI GLFWwindow glfwCreateWindow(int width, int height,
if (mode != GLFW_WINDOWED && mode != GLFW_FULLSCREEN)
{
_glfwSetError(GLFW_INVALID_ENUM,
- "glfwCreateWindow: Invalid enum for 'mode' parameter");
+ "glfwCreateWindow: Invalid window mode");
return GL_FALSE;
}
@@ -292,8 +292,7 @@ GLFWAPI GLFWwindow glfwCreateWindow(int width, int height,
window = (_GLFWwindow*) malloc(sizeof(_GLFWwindow));
if (!window)
{
- _glfwSetError(GLFW_OUT_OF_MEMORY,
- "glfwCreateWindow: Failed to allocate window structure");
+ _glfwSetError(GLFW_OUT_OF_MEMORY, NULL);
return NULL;
}
diff --git a/src/x11_clipboard.c b/src/x11_clipboard.c
index a833ed1f..5bc92d44 100644
--- a/src/x11_clipboard.c
+++ b/src/x11_clipboard.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: X11/GLX
+// Platform: X11
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
@@ -182,7 +182,7 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
if (_glfwLibrary.X11.selection.status == _GLFW_CONVERSION_FAILED)
{
_glfwSetError(GLFW_FORMAT_UNAVAILABLE,
- "X11/GLX: Failed to convert selection to string");
+ "X11: Failed to convert selection to string");
return NULL;
}
diff --git a/src/x11_fullscreen.c b/src/x11_fullscreen.c
index 8c4138d3..346aefb7 100644
--- a/src/x11_fullscreen.c
+++ b/src/x11_fullscreen.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: X11/GLX
+// Platform: X11
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
@@ -442,7 +442,7 @@ GLFWvidmode* _glfwPlatformGetVideoModes(int* found)
if (visuals == NULL)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "X11/GLX: Failed to retrieve the available visuals");
+ "X11: Failed to retrieve the available visuals");
return 0;
}
diff --git a/src/x11_gamma.c b/src/x11_gamma.c
index 44cd1139..148ae740 100644
--- a/src/x11_gamma.c
+++ b/src/x11_gamma.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: X11/GLX
+// Platform: X11
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
@@ -115,7 +115,7 @@ void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp)
if (_glfwLibrary.originalRampSize != GLFW_GAMMA_RAMP_SIZE)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "X11/GLX: Failed to get gamma ramp due to size "
+ "X11: Failed to get gamma ramp due to size "
"incompatibility");
return;
}
@@ -166,7 +166,7 @@ void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp)
if (_glfwLibrary.originalRampSize != GLFW_GAMMA_RAMP_SIZE)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "X11/GLX: Failed to set gamma ramp due to size "
+ "X11: Failed to set gamma ramp due to size "
"incompatibility");
return;
}
diff --git a/src/x11_init.c b/src/x11_init.c
index 372fc2dd..35f66c0f 100644
--- a/src/x11_init.c
+++ b/src/x11_init.c
@@ -491,7 +491,7 @@ static GLboolean initDisplay(void)
_glfwLibrary.X11.display = XOpenDisplay(NULL);
if (!_glfwLibrary.X11.display)
{
- _glfwSetError(GLFW_OPENGL_UNAVAILABLE, "X11/GLX: Failed to open X display");
+ _glfwSetError(GLFW_OPENGL_UNAVAILABLE, "X11: Failed to open X display");
return GL_FALSE;
}
@@ -525,7 +525,7 @@ static GLboolean initDisplay(void)
&_glfwLibrary.X11.RandR.minorVersion))
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "X11/GLX: Failed to query RandR version");
+ "X11: Failed to query RandR version");
return GL_FALSE;
}
}
diff --git a/src/x11_input.c b/src/x11_input.c
index 49961395..2ea8b8c4 100644
--- a/src/x11_input.c
+++ b/src/x11_input.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: X11 (Unix)
+// Platform: X11
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
diff --git a/src/x11_joystick.c b/src/x11_joystick.c
index 523a4b3d..8492850b 100644
--- a/src/x11_joystick.c
+++ b/src/x11_joystick.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: X11/GLX
+// Platform: X11
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
diff --git a/src/x11_keysym2unicode.c b/src/x11_keysym2unicode.c
index 1f610fdd..c0d10c6e 100644
--- a/src/x11_keysym2unicode.c
+++ b/src/x11_keysym2unicode.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: X11/GLX
+// Platform: X11
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
diff --git a/src/x11_opengl.c b/src/x11_opengl.c
index 2a5cc451..a7c3f61b 100644
--- a/src/x11_opengl.c
+++ b/src/x11_opengl.c
@@ -78,7 +78,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
if (!_glfwLibrary.GLX.SGIX_fbconfig)
{
_glfwSetError(GLFW_OPENGL_UNAVAILABLE,
- "X11/GLX: GLXFBConfig support not found");
+ "GLX: GLXFBConfig support not found");
return NULL;
}
}
@@ -101,7 +101,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
if (!count)
{
_glfwSetError(GLFW_OPENGL_UNAVAILABLE,
- "X11/GLX: No GLXFBConfigs returned");
+ "GLX: No GLXFBConfigs returned");
return NULL;
}
}
@@ -113,7 +113,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
if (!count)
{
_glfwSetError(GLFW_OPENGL_UNAVAILABLE,
- "X11/GLX: No GLXFBConfigs returned");
+ "GLX: No GLXFBConfigs returned");
return NULL;
}
}
@@ -121,8 +121,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
result = (_GLFWfbconfig*) malloc(sizeof(_GLFWfbconfig) * count);
if (!result)
{
- _glfwSetError(GLFW_OUT_OF_MEMORY,
- "X11/GLX: Failed to allocate _GLFWfbconfig array");
+ _glfwSetError(GLFW_OUT_OF_MEMORY, NULL);
return NULL;
}
@@ -242,7 +241,7 @@ static int createContext(_GLFWwindow* window,
if (fbconfig == NULL)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "X11/GLX: Failed to retrieve the selected GLXFBConfig");
+ "GLX: Failed to retrieve the selected GLXFBConfig");
return GL_FALSE;
}
}
@@ -264,7 +263,7 @@ static int createContext(_GLFWwindow* window,
XFree(fbconfig);
_glfwSetError(GLFW_PLATFORM_ERROR,
- "X11/GLX: Failed to retrieve visual for GLXFBConfig");
+ "GLX: Failed to retrieve visual for GLXFBConfig");
return GL_FALSE;
}
@@ -303,7 +302,7 @@ static int createContext(_GLFWwindow* window,
if (!_glfwLibrary.GLX.ARB_create_context_profile)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "X11/GLX: An OpenGL profile requested but "
+ "GLX: An OpenGL profile requested but "
"GLX_ARB_create_context_profile is unavailable");
return GL_FALSE;
}
@@ -312,7 +311,7 @@ static int createContext(_GLFWwindow* window,
!_glfwLibrary.GLX.EXT_create_context_es2_profile)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "X11/GLX: OpenGL ES 2.x profile requested but "
+ "GLX: OpenGL ES 2.x profile requested but "
"GLX_EXT_create_context_es2_profile is unavailable");
return GL_FALSE;
}
@@ -334,7 +333,7 @@ static int createContext(_GLFWwindow* window,
if (!_glfwLibrary.GLX.ARB_create_context_robustness)
{
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "X11/GLX: An OpenGL robustness strategy was "
+ "GLX: An OpenGL robustness strategy was "
"requested but GLX_ARB_create_context_robustness "
"is unavailable");
return GL_FALSE;
@@ -397,7 +396,7 @@ static int createContext(_GLFWwindow* window,
// TODO: Handle all the various error codes here
_glfwSetError(GLFW_PLATFORM_ERROR,
- "X11/GLX: Failed to create OpenGL context");
+ "GLX: Failed to create OpenGL context");
return GL_FALSE;
}
@@ -437,7 +436,7 @@ int _glfwInitOpenGL(void)
if (!_glfwLibrary.GLX.libGL)
{
- _glfwSetError(GLFW_PLATFORM_ERROR, "X11/GLX: Failed to find libGL");
+ _glfwSetError(GLFW_PLATFORM_ERROR, "GLX: Failed to find libGL");
return GL_FALSE;
}
#endif
@@ -445,7 +444,7 @@ int _glfwInitOpenGL(void)
// Check if GLX is supported on this display
if (!glXQueryExtension(_glfwLibrary.X11.display, NULL, NULL))
{
- _glfwSetError(GLFW_OPENGL_UNAVAILABLE, "X11/GLX: GLX support not found");
+ _glfwSetError(GLFW_OPENGL_UNAVAILABLE, "GLX: GLX support not found");
return GL_FALSE;
}
@@ -454,7 +453,7 @@ int _glfwInitOpenGL(void)
&_glfwLibrary.GLX.minorVersion))
{
_glfwSetError(GLFW_OPENGL_UNAVAILABLE,
- "X11/GLX: Failed to query GLX version");
+ "GLX: Failed to query GLX version");
return GL_FALSE;
}
@@ -565,17 +564,13 @@ int _glfwCreateContext(_GLFWwindow* window,
fbconfigs = getFBConfigs(window, &fbcount);
if (!fbconfigs)
- {
- _glfwSetError(GLFW_PLATFORM_ERROR,
- "X11/GLX: No usable GLXFBConfigs found");
return GL_FALSE;
- }
result = _glfwChooseFBConfig(fbconfig, fbconfigs, fbcount);
if (!result)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "X11/GLX: No GLXFBConfig matched the criteria");
+ "GLX: No GLXFBConfig matched the criteria");
free(fbconfigs);
return GL_FALSE;
diff --git a/src/x11_time.c b/src/x11_time.c
index f1445233..bf3335d3 100644
--- a/src/x11_time.c
+++ b/src/x11_time.c
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
-// Platform: X11/GLX
+// Platform: X11
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
diff --git a/src/x11_window.c b/src/x11_window.c
index 6d7021a0..a34449d8 100644
--- a/src/x11_window.c
+++ b/src/x11_window.c
@@ -131,8 +131,7 @@ static GLboolean createWindow(_GLFWwindow* window,
// TODO: Handle all the various error codes here and translate them
// to GLFW errors
- _glfwSetError(GLFW_PLATFORM_ERROR,
- "X11/GLX: Failed to create window");
+ _glfwSetError(GLFW_PLATFORM_ERROR, "X11: Failed to create window");
return GL_FALSE;
}
}
@@ -191,7 +190,7 @@ static GLboolean createWindow(_GLFWwindow* window,
if (!hints)
{
_glfwSetError(GLFW_OUT_OF_MEMORY,
- "X11/GLX: Failed to allocate WM hints");
+ "X11: Failed to allocate WM hints");
return GL_FALSE;
}
@@ -208,7 +207,7 @@ static GLboolean createWindow(_GLFWwindow* window,
if (!hints)
{
_glfwSetError(GLFW_OUT_OF_MEMORY,
- "X11/GLX: Failed to allocate size hints");
+ "X11: Failed to allocate size hints");
return GL_FALSE;
}
From 53245d754e350fc96370e6d28b7678c439a857c2 Mon Sep 17 00:00:00 2001
From: Camilla Berglund
Date: Tue, 28 Aug 2012 20:16:43 +0200
Subject: [PATCH 05/16] Added detection of joystick disconnect on X11.
---
src/x11_joystick.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/x11_joystick.c b/src/x11_joystick.c
index 8492850b..7f4fdbc1 100644
--- a/src/x11_joystick.c
+++ b/src/x11_joystick.c
@@ -36,6 +36,7 @@
#include
#include
#include
+#include
#include
#include
@@ -109,6 +110,7 @@ static void pollJoystickEvents(void)
{
#ifdef _GLFW_USE_LINUX_JOYSTICKS
int i;
+ ssize_t result;
struct js_event e;
for (i = 0; i <= GLFW_JOYSTICK_LAST; i++)
@@ -117,8 +119,17 @@ static void pollJoystickEvents(void)
continue;
// Read all queued events (non-blocking)
- while (read(_glfwLibrary.X11.joystick[i].fd, &e, sizeof(e)) > 0)
+ for (;;)
{
+ errno = 0;
+ result = read(_glfwLibrary.X11.joystick[i].fd, &e, sizeof(e));
+
+ if (errno == ENODEV)
+ _glfwLibrary.X11.joystick[i].present = GL_FALSE;
+
+ if (result <= 0)
+ break;
+
// We don't care if it's an init event or not
e.type &= ~JS_EVENT_INIT;
@@ -221,6 +232,8 @@ void _glfwTerminateJoysticks(void)
int _glfwPlatformGetJoystickParam(int joy, int param)
{
+ pollJoystickEvents();
+
if (!_glfwLibrary.X11.joystick[joy].present)
return 0;
@@ -251,11 +264,11 @@ int _glfwPlatformGetJoystickPos(int joy, float* pos, int numAxes)
{
int i;
+ pollJoystickEvents();
+
if (!_glfwLibrary.X11.joystick[joy].present)
return 0;
- pollJoystickEvents();
-
if (_glfwLibrary.X11.joystick[joy].numAxes < numAxes)
numAxes = _glfwLibrary.X11.joystick[joy].numAxes;
@@ -275,11 +288,11 @@ int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons,
{
int i;
+ pollJoystickEvents();
+
if (!_glfwLibrary.X11.joystick[joy].present)
return 0;
- pollJoystickEvents();
-
if (_glfwLibrary.X11.joystick[joy].numButtons < numButtons)
numButtons = _glfwLibrary.X11.joystick[joy].numButtons;
From 54fceaaf64a7d5205953a472e774d1ac748ee31a Mon Sep 17 00:00:00 2001
From: Camilla Berglund
Date: Tue, 28 Aug 2012 20:24:37 +0200
Subject: [PATCH 06/16] Clarified result comparison.
---
src/x11_joystick.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/x11_joystick.c b/src/x11_joystick.c
index 7f4fdbc1..09885373 100644
--- a/src/x11_joystick.c
+++ b/src/x11_joystick.c
@@ -127,7 +127,7 @@ static void pollJoystickEvents(void)
if (errno == ENODEV)
_glfwLibrary.X11.joystick[i].present = GL_FALSE;
- if (result <= 0)
+ if (result < sizeof(e))
break;
// We don't care if it's an init event or not
From f50d38f14815979b3a9f21febbf4a96433778b45 Mon Sep 17 00:00:00 2001
From: Camilla Berglund
Date: Tue, 28 Aug 2012 22:56:35 +0200
Subject: [PATCH 07/16] Moved glfwinfo version check to before glfwInit.
---
tests/glfwinfo.c | 42 ++++++++++++++++++++++--------------------
1 file changed, 22 insertions(+), 20 deletions(-)
diff --git a/tests/glfwinfo.c b/tests/glfwinfo.c
index 90fd329f..11a84612 100644
--- a/tests/glfwinfo.c
+++ b/tests/glfwinfo.c
@@ -181,6 +181,28 @@ int main(int argc, char** argv)
argc -= optind;
argv += optind;
+ // Report GLFW version
+
+ glfwGetVersion(&major, &minor, &revision);
+
+ printf("GLFW header version: %u.%u.%u\n",
+ GLFW_VERSION_MAJOR,
+ GLFW_VERSION_MINOR,
+ GLFW_VERSION_REVISION);
+
+ printf("GLFW library version: %u.%u.%u\n", major, minor, revision);
+
+ if (major != GLFW_VERSION_MAJOR ||
+ minor != GLFW_VERSION_MINOR ||
+ revision != GLFW_VERSION_REVISION)
+ {
+ printf("*** WARNING: GLFW version mismatch! ***\n");
+ }
+
+ printf("GLFW library version string: \"%s\"\n", glfwGetVersionString());
+
+ // Initialize GLFW and create window
+
glfwSetErrorCallback(error_callback);
if (!glfwInit())
@@ -216,26 +238,6 @@ int main(int argc, char** argv)
glfwMakeContextCurrent(window);
- // Report GLFW version
-
- glfwGetVersion(&major, &minor, &revision);
-
- printf("GLFW header version: %u.%u.%u\n",
- GLFW_VERSION_MAJOR,
- GLFW_VERSION_MINOR,
- GLFW_VERSION_REVISION);
-
- printf("GLFW library version: %u.%u.%u\n", major, minor, revision);
-
- if (major != GLFW_VERSION_MAJOR ||
- minor != GLFW_VERSION_MINOR ||
- revision != GLFW_VERSION_REVISION)
- {
- printf("*** WARNING: GLFW version mismatch! ***\n");
- }
-
- printf("GLFW library version string: \"%s\"\n", glfwGetVersionString());
-
// Report OpenGL version
printf("OpenGL context version string: \"%s\"\n", glGetString(GL_VERSION));
From 3ef7c554585ce80621d5710c7ce052739d82fad4 Mon Sep 17 00:00:00 2001
From: Camilla Berglund
Date: Wed, 29 Aug 2012 01:24:53 +0200
Subject: [PATCH 08/16] Added credit.
---
readme.html | 2 ++
1 file changed, 2 insertions(+)
diff --git a/readme.html b/readme.html
index 39d0739b..23c9113f 100644
--- a/readme.html
+++ b/readme.html
@@ -950,6 +950,8 @@ their skills. Special thanks go out to:
Samuli Tuomola, for support, bug reports and testing
+ Torsten Walluhn, for fixing various compilation issues on OS X
+
Frank Wille, for helping with the AmigaOS port and making GLFW
compile under IRIX 5.3
From 54f1a57f8d33faaa2f569a74cebdff557b5a851b Mon Sep 17 00:00:00 2001
From: Camilla Berglund
Date: Wed, 29 Aug 2012 16:00:54 +0200
Subject: [PATCH 09/16] Added channel bit depth hint defaults.
---
src/window.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/window.c b/src/window.c
index acd48195..e59a1d25 100644
--- a/src/window.c
+++ b/src/window.c
@@ -84,6 +84,12 @@ void _glfwSetDefaultWindowHints(void)
// The default is to allow window resizing
_glfwLibrary.hints.resizable = GL_TRUE;
+
+ // The default is 24 bits of depth, 8 bits of color
+ _glfwLibrary.hints.depthBits = 24;
+ _glfwLibrary.hints.redBits = 8;
+ _glfwLibrary.hints.greenBits = 8;
+ _glfwLibrary.hints.blueBits = 8;
}
From 74f5cd6fa7f00cd1a8b838371dc15458620c9e0a Mon Sep 17 00:00:00 2001
From: Camilla Berglund
Date: Wed, 29 Aug 2012 16:12:44 +0200
Subject: [PATCH 10/16] Removed unused example files.
---
examples/particles.c | 1152 -----------------------------------
examples/pong3d.c | 854 --------------------------
examples/pong3d_field.tga | Bin 17816 -> 0 bytes
examples/pong3d_instr.tga | Bin 21279 -> 0 bytes
examples/pong3d_menu.tga | Bin 1835 -> 0 bytes
examples/pong3d_title.tga | Bin 106516 -> 0 bytes
examples/pong3d_winner1.tga | Bin 861 -> 0 bytes
examples/pong3d_winner2.tga | Bin 891 -> 0 bytes
8 files changed, 2006 deletions(-)
delete mode 100644 examples/particles.c
delete mode 100644 examples/pong3d.c
delete mode 100644 examples/pong3d_field.tga
delete mode 100644 examples/pong3d_instr.tga
delete mode 100644 examples/pong3d_menu.tga
delete mode 100644 examples/pong3d_title.tga
delete mode 100644 examples/pong3d_winner1.tga
delete mode 100644 examples/pong3d_winner2.tga
diff --git a/examples/particles.c b/examples/particles.c
deleted file mode 100644
index c7904e11..00000000
--- a/examples/particles.c
+++ /dev/null
@@ -1,1152 +0,0 @@
-//========================================================================
-// This is a simple, but cool particle engine (buzz-word meaning many
-// small objects that are treated as points and drawn as textures
-// projected on simple geometry).
-//
-// This demonstration generates a colorful fountain-like animation. It
-// uses several advanced OpenGL teqhniques:
-//
-// 1) Lighting (per vertex)
-// 2) Alpha blending
-// 3) Fog
-// 4) Texturing
-// 5) Display lists (for drawing the static environment geometry)
-// 6) Vertex arrays (for drawing the particles)
-// 7) GL_EXT_separate_specular_color is used (if available)
-//
-// Even more so, this program uses multi threading. The program is
-// essentialy divided into a main rendering thread and a particle physics
-// calculation thread. My benchmarks under Windows 2000 on a single
-// processor system show that running this program as two threads instead
-// of a single thread means no difference (there may be a very marginal
-// advantage for the multi threaded case). On dual processor systems I
-// have had reports of 5-25% of speed increase when running this program
-// as two threads instead of one thread.
-//
-// The default behaviour of this program is to use two threads. To force
-// a single thread to be used, use the command line switch -s.
-//
-// To run a fixed length benchmark (60 s), use the command line switch -b.
-//
-// Benchmark results (640x480x16, best of three tests):
-//
-// CPU GFX 1 thread 2 threads
-// Athlon XP 2700+ GeForce Ti4200 (oc) 757 FPS 759 FPS
-// P4 2.8 GHz (SMT) GeForce FX5600 548 FPS 550 FPS
-//
-// One more thing: Press 'w' during the demo to toggle wireframe mode.
-//========================================================================
-
-#include
-#include
-#include
-#include
-#include
-
-// Define tokens for GL_EXT_separate_specular_color if not already defined
-#ifndef GL_EXT_separate_specular_color
-#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
-#define GL_SINGLE_COLOR_EXT 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
-#endif // GL_EXT_separate_specular_color
-
-// Some 's do not define M_PI
-#ifndef M_PI
-#define M_PI 3.141592654
-#endif
-
-// Desired fullscreen resolution
-#define WIDTH 640
-#define HEIGHT 480
-
-
-//========================================================================
-// Type definitions
-//========================================================================
-
-typedef struct { float x,y,z; } VEC;
-
-// This structure is used for interleaved vertex arrays (see the
-// DrawParticles function) - Note: This structure SHOULD be packed on most
-// systems. It uses 32-bit fields on 32-bit boundaries, and is a multiple
-// of 64 bits in total (6x32=3x64). If it does not work, try using pragmas
-// or whatever to force the structure to be packed.
-typedef struct {
- GLfloat s, t; // Texture coordinates
- GLuint rgba; // Color (four ubytes packed into an uint)
- GLfloat x, y, z; // Vertex coordinates
-} VERTEX;
-
-
-//========================================================================
-// Program control global variables
-//========================================================================
-
-// "Running" flag (true if program shall continue to run)
-int running;
-
-// Window dimensions
-int width, height;
-
-// "wireframe" flag (true if we use wireframe view)
-int wireframe;
-
-// "multithreading" flag (true if we use multithreading)
-int multithreading;
-
-// Thread synchronization
-struct {
- double t; // Time (s)
- float dt; // Time since last frame (s)
- int p_frame; // Particle physics frame number
- int d_frame; // Particle draw frame number
- GLFWcond p_done; // Condition: particle physics done
- GLFWcond d_done; // Condition: particle draw done
- GLFWmutex particles_lock; // Particles data sharing mutex
-} thread_sync;
-
-
-//========================================================================
-// Texture declarations (we hard-code them into the source code, since
-// they are so simple)
-//========================================================================
-
-#define P_TEX_WIDTH 8 // Particle texture dimensions
-#define P_TEX_HEIGHT 8
-#define F_TEX_WIDTH 16 // Floor texture dimensions
-#define F_TEX_HEIGHT 16
-
-// Texture object IDs
-GLuint particle_tex_id, floor_tex_id;
-
-// Particle texture (a simple spot)
-const unsigned char particle_texture[ P_TEX_WIDTH * P_TEX_HEIGHT ] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x11, 0x22, 0x22, 0x11, 0x00, 0x00,
- 0x00, 0x11, 0x33, 0x88, 0x77, 0x33, 0x11, 0x00,
- 0x00, 0x22, 0x88, 0xff, 0xee, 0x77, 0x22, 0x00,
- 0x00, 0x22, 0x77, 0xee, 0xff, 0x88, 0x22, 0x00,
- 0x00, 0x11, 0x33, 0x77, 0x88, 0x33, 0x11, 0x00,
- 0x00, 0x00, 0x11, 0x33, 0x22, 0x11, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-// Floor texture (your basic checkered floor)
-const unsigned char floor_texture[ F_TEX_WIDTH * F_TEX_HEIGHT ] = {
- 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0xff, 0xf0, 0xcc, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0xf0, 0xcc, 0xee, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x30, 0x66, 0x30, 0x30, 0x30, 0x20, 0x30, 0x30,
- 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xee, 0xf0, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0xf0, 0xf0, 0xf0, 0xf0, 0xcc, 0xf0, 0xf0, 0xf0, 0x30, 0x30, 0x55, 0x30, 0x30, 0x44, 0x30, 0x30,
- 0xf0, 0xdd, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x60, 0x30,
- 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x33, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x30, 0x30, 0xf0, 0xff, 0xf0, 0xf0, 0xdd, 0xf0, 0xf0, 0xff,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x55, 0x33, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xf0,
- 0x30, 0x44, 0x66, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xaa, 0xf0, 0xf0, 0xcc, 0xf0,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xff, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xdd, 0xf0,
- 0x30, 0x30, 0x30, 0x77, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
-};
-
-
-//========================================================================
-// These are fixed constants that control the particle engine. In a
-// modular world, these values should be variables...
-//========================================================================
-
-// Maximum number of particles
-#define MAX_PARTICLES 3000
-
-// Life span of a particle (in seconds)
-#define LIFE_SPAN 8.0f
-
-// A new particle is born every [BIRTH_INTERVAL] second
-#define BIRTH_INTERVAL (LIFE_SPAN/(float)MAX_PARTICLES)
-
-// Particle size (meters)
-#define PARTICLE_SIZE 0.7f
-
-// Gravitational constant (m/s^2)
-#define GRAVITY 9.8f
-
-// Base initial velocity (m/s)
-#define VELOCITY 8.0f
-
-// Bounce friction (1.0 = no friction, 0.0 = maximum friction)
-#define FRICTION 0.75f
-
-// "Fountain" height (m)
-#define FOUNTAIN_HEIGHT 3.0f
-
-// Fountain radius (m)
-#define FOUNTAIN_RADIUS 1.6f
-
-// Minimum delta-time for particle phisics (s)
-#define MIN_DELTA_T (BIRTH_INTERVAL * 0.5f)
-
-
-//========================================================================
-// Particle system global variables
-//========================================================================
-
-// This structure holds all state for a single particle
-typedef struct {
- float x,y,z; // Position in space
- float vx,vy,vz; // Velocity vector
- float r,g,b; // Color of particle
- float life; // Life of particle (1.0 = newborn, < 0.0 = dead)
- int active; // Tells if this particle is active
-} PARTICLE;
-
-// Global vectors holding all particles. We use two vectors for double
-// buffering.
-static PARTICLE particles[ MAX_PARTICLES ];
-
-// Global variable holding the age of the youngest particle
-static float min_age;
-
-// Color of latest born particle (used for fountain lighting)
-static float glow_color[4];
-
-// Position of latest born particle (used for fountain lighting)
-static float glow_pos[4];
-
-
-//========================================================================
-// Object material and fog configuration constants
-//========================================================================
-
-const GLfloat fountain_diffuse[4] = {0.7f,1.0f,1.0f,1.0f};
-const GLfloat fountain_specular[4] = {1.0f,1.0f,1.0f,1.0f};
-const GLfloat fountain_shininess = 12.0f;
-const GLfloat floor_diffuse[4] = {1.0f,0.6f,0.6f,1.0f};
-const GLfloat floor_specular[4] = {0.6f,0.6f,0.6f,1.0f};
-const GLfloat floor_shininess = 18.0f;
-const GLfloat fog_color[4] = {0.1f, 0.1f, 0.1f, 1.0f};
-
-
-//========================================================================
-// InitParticle() - Initialize a new particle
-//========================================================================
-
-void InitParticle( PARTICLE *p, double t )
-{
- float xy_angle, velocity;
-
- // Start position of particle is at the fountain blow-out
- p->x = 0.0f;
- p->y = 0.0f;
- p->z = FOUNTAIN_HEIGHT;
-
- // Start velocity is up (Z)...
- p->vz = 0.7f + (0.3f/4096.f) * (float) (rand() & 4095);
-
- // ...and a randomly chosen X/Y direction
- xy_angle = (2.f * (float)M_PI / 4096.f) * (float) (rand() & 4095);
- p->vx = 0.4f * (float) cos( xy_angle );
- p->vy = 0.4f * (float) sin( xy_angle );
-
- // Scale velocity vector according to a time-varying velocity
- velocity = VELOCITY*(0.8f + 0.1f*(float)(sin( 0.5*t )+sin( 1.31*t )));
- p->vx *= velocity;
- p->vy *= velocity;
- p->vz *= velocity;
-
- // Color is time-varying
- p->r = 0.7f + 0.3f * (float) sin( 0.34*t + 0.1 );
- p->g = 0.6f + 0.4f * (float) sin( 0.63*t + 1.1 );
- p->b = 0.6f + 0.4f * (float) sin( 0.91*t + 2.1 );
-
- // Store settings for fountain glow lighting
- glow_pos[0] = 0.4f * (float) sin( 1.34*t );
- glow_pos[1] = 0.4f * (float) sin( 3.11*t );
- glow_pos[2] = FOUNTAIN_HEIGHT + 1.0f;
- glow_pos[3] = 1.0f;
- glow_color[0] = p->r;
- glow_color[1] = p->g;
- glow_color[2] = p->b;
- glow_color[3] = 1.0f;
-
- // The particle is new-born and active
- p->life = 1.0f;
- p->active = 1;
-}
-
-
-//========================================================================
-// UpdateParticle() - Update a particle
-//========================================================================
-
-#define FOUNTAIN_R2 (FOUNTAIN_RADIUS+PARTICLE_SIZE/2)*(FOUNTAIN_RADIUS+PARTICLE_SIZE/2)
-
-void UpdateParticle( PARTICLE *p, float dt )
-{
- // If the particle is not active, we need not do anything
- if( !p->active )
- {
- return;
- }
-
- // The particle is getting older...
- p->life = p->life - dt * (1.0f / LIFE_SPAN);
-
- // Did the particle die?
- if( p->life <= 0.0f )
- {
- p->active = 0;
- return;
- }
-
- // Update particle velocity (apply gravity)
- p->vz = p->vz - GRAVITY * dt;
-
- // Update particle position
- p->x = p->x + p->vx * dt;
- p->y = p->y + p->vy * dt;
- p->z = p->z + p->vz * dt;
-
- // Simple collision detection + response
- if( p->vz < 0.0f )
- {
- // Particles should bounce on the fountain (with friction)
- if( (p->x*p->x + p->y*p->y) < FOUNTAIN_R2 &&
- p->z < (FOUNTAIN_HEIGHT + PARTICLE_SIZE/2) )
- {
- p->vz = -FRICTION * p->vz;
- p->z = FOUNTAIN_HEIGHT + PARTICLE_SIZE/2 +
- FRICTION * (FOUNTAIN_HEIGHT +
- PARTICLE_SIZE/2 - p->z);
- }
-
- // Particles should bounce on the floor (with friction)
- else if( p->z < PARTICLE_SIZE/2 )
- {
- p->vz = -FRICTION * p->vz;
- p->z = PARTICLE_SIZE/2 +
- FRICTION * (PARTICLE_SIZE/2 - p->z);
- }
-
- }
-}
-
-
-//========================================================================
-// ParticleEngine() - The main frame for the particle engine. Called once
-// per frame.
-//========================================================================
-
-void ParticleEngine( double t, float dt )
-{
- int i;
- float dt2;
-
- // Update particles (iterated several times per frame if dt is too
- // large)
- while( dt > 0.0f )
- {
- // Calculate delta time for this iteration
- dt2 = dt < MIN_DELTA_T ? dt : MIN_DELTA_T;
-
- // Update particles
- for( i = 0; i < MAX_PARTICLES; i ++ )
- {
- UpdateParticle( &particles[ i ], dt2 );
- }
-
- // Increase minimum age
- min_age += dt2;
-
- // Should we create any new particle(s)?
- while( min_age >= BIRTH_INTERVAL )
- {
- min_age -= BIRTH_INTERVAL;
-
- // Find a dead particle to replace with a new one
- for( i = 0; i < MAX_PARTICLES; i ++ )
- {
- if( !particles[ i ].active )
- {
- InitParticle( &particles[ i ], t + min_age );
- UpdateParticle( &particles[ i ], min_age );
- break;
- }
- }
- }
-
- // Decrease frame delta time
- dt -= dt2;
- }
-}
-
-
-//========================================================================
-// DrawParticles() - Draw all active particles. We use OpenGL 1.1 vertex
-// arrays for this in order to accelerate the drawing.
-//========================================================================
-
-#define BATCH_PARTICLES 70 // Number of particles to draw in each batch
- // (70 corresponds to 7.5 KB = will not blow
- // the L1 data cache on most CPUs)
-#define PARTICLE_VERTS 4 // Number of vertices per particle
-
-void DrawParticles( double t, float dt )
-{
- int i, particle_count;
- VERTEX vertex_array[ BATCH_PARTICLES * PARTICLE_VERTS ], *vptr;
- float alpha;
- GLuint rgba;
- VEC quad_lower_left, quad_lower_right;
- GLfloat mat[ 16 ];
- PARTICLE *pptr;
-
- // Here comes the real trick with flat single primitive objects (s.c.
- // "billboards"): We must rotate the textured primitive so that it
- // always faces the viewer (is coplanar with the view-plane).
- // We:
- // 1) Create the primitive around origo (0,0,0)
- // 2) Rotate it so that it is coplanar with the view plane
- // 3) Translate it according to the particle position
- // Note that 1) and 2) is the same for all particles (done only once).
-
- // Get modelview matrix. We will only use the upper left 3x3 part of
- // the matrix, which represents the rotation.
- glGetFloatv( GL_MODELVIEW_MATRIX, mat );
-
- // 1) & 2) We do it in one swift step:
- // Although not obvious, the following six lines represent two matrix/
- // vector multiplications. The matrix is the inverse 3x3 rotation
- // matrix (i.e. the transpose of the same matrix), and the two vectors
- // represent the lower left corner of the quad, PARTICLE_SIZE/2 *
- // (-1,-1,0), and the lower right corner, PARTICLE_SIZE/2 * (1,-1,0).
- // The upper left/right corners of the quad is always the negative of
- // the opposite corners (regardless of rotation).
- quad_lower_left.x = (-PARTICLE_SIZE/2) * (mat[0] + mat[1]);
- quad_lower_left.y = (-PARTICLE_SIZE/2) * (mat[4] + mat[5]);
- quad_lower_left.z = (-PARTICLE_SIZE/2) * (mat[8] + mat[9]);
- quad_lower_right.x = (PARTICLE_SIZE/2) * (mat[0] - mat[1]);
- quad_lower_right.y = (PARTICLE_SIZE/2) * (mat[4] - mat[5]);
- quad_lower_right.z = (PARTICLE_SIZE/2) * (mat[8] - mat[9]);
-
- // Don't update z-buffer, since all particles are transparent!
- glDepthMask( GL_FALSE );
-
- // Enable blending
- glEnable( GL_BLEND );
- glBlendFunc( GL_SRC_ALPHA, GL_ONE );
-
- // Select particle texture
- if( !wireframe )
- {
- glEnable( GL_TEXTURE_2D );
- glBindTexture( GL_TEXTURE_2D, particle_tex_id );
- }
-
- // Set up vertex arrays. We use interleaved arrays, which is easier to
- // handle (in most situations) and it gives a linear memeory access
- // access pattern (which may give better performance in some
- // situations). GL_T2F_C4UB_V3F means: 2 floats for texture coords,
- // 4 ubytes for color and 3 floats for vertex coord (in that order).
- // Most OpenGL cards / drivers are optimized for this format.
- glInterleavedArrays( GL_T2F_C4UB_V3F, 0, vertex_array );
-
- // Is particle physics carried out in a separate thread?
- if( multithreading )
- {
- // Wait for particle physics thread to be done
- glfwLockMutex( thread_sync.particles_lock );
- while( running && thread_sync.p_frame <= thread_sync.d_frame )
- {
- glfwWaitCond( thread_sync.p_done, thread_sync.particles_lock,
- 0.1 );
- }
-
- // Store the frame time and delta time for the physics thread
- thread_sync.t = t;
- thread_sync.dt = dt;
-
- // Update frame counter
- thread_sync.d_frame ++;
- }
- else
- {
- // Perform particle physics in this thread
- ParticleEngine( t, dt );
- }
-
- // Loop through all particles and build vertex arrays.
- particle_count = 0;
- vptr = vertex_array;
- pptr = particles;
- for( i = 0; i < MAX_PARTICLES; i ++ )
- {
- if( pptr->active )
- {
- // Calculate particle intensity (we set it to max during 75%
- // of its life, then it fades out)
- alpha = 4.0f * pptr->life;
- if( alpha > 1.0f )
- {
- alpha = 1.0f;
- }
-
- // Convert color from float to 8-bit (store it in a 32-bit
- // integer using endian independent type casting)
- ((GLubyte *)&rgba)[0] = (GLubyte)(pptr->r * 255.0f);
- ((GLubyte *)&rgba)[1] = (GLubyte)(pptr->g * 255.0f);
- ((GLubyte *)&rgba)[2] = (GLubyte)(pptr->b * 255.0f);
- ((GLubyte *)&rgba)[3] = (GLubyte)(alpha * 255.0f);
-
- // 3) Translate the quad to the correct position in modelview
- // space and store its parameters in vertex arrays (we also
- // store texture coord and color information for each vertex).
-
- // Lower left corner
- vptr->s = 0.0f;
- vptr->t = 0.0f;
- vptr->rgba = rgba;
- vptr->x = pptr->x + quad_lower_left.x;
- vptr->y = pptr->y + quad_lower_left.y;
- vptr->z = pptr->z + quad_lower_left.z;
- vptr ++;
-
- // Lower right corner
- vptr->s = 1.0f;
- vptr->t = 0.0f;
- vptr->rgba = rgba;
- vptr->x = pptr->x + quad_lower_right.x;
- vptr->y = pptr->y + quad_lower_right.y;
- vptr->z = pptr->z + quad_lower_right.z;
- vptr ++;
-
- // Upper right corner
- vptr->s = 1.0f;
- vptr->t = 1.0f;
- vptr->rgba = rgba;
- vptr->x = pptr->x - quad_lower_left.x;
- vptr->y = pptr->y - quad_lower_left.y;
- vptr->z = pptr->z - quad_lower_left.z;
- vptr ++;
-
- // Upper left corner
- vptr->s = 0.0f;
- vptr->t = 1.0f;
- vptr->rgba = rgba;
- vptr->x = pptr->x - quad_lower_right.x;
- vptr->y = pptr->y - quad_lower_right.y;
- vptr->z = pptr->z - quad_lower_right.z;
- vptr ++;
-
- // Increase count of drawable particles
- particle_count ++;
- }
-
- // If we have filled up one batch of particles, draw it as a set
- // of quads using glDrawArrays.
- if( particle_count >= BATCH_PARTICLES )
- {
- // The first argument tells which primitive type we use (QUAD)
- // The second argument tells the index of the first vertex (0)
- // The last argument is the vertex count
- glDrawArrays( GL_QUADS, 0, PARTICLE_VERTS * particle_count );
- particle_count = 0;
- vptr = vertex_array;
- }
-
- // Next particle
- pptr ++;
- }
-
- // We are done with the particle data: Unlock mutex and signal physics
- // thread
- if( multithreading )
- {
- glfwUnlockMutex( thread_sync.particles_lock );
- glfwSignalCond( thread_sync.d_done );
- }
-
- // Draw final batch of particles (if any)
- glDrawArrays( GL_QUADS, 0, PARTICLE_VERTS * particle_count );
-
- // Disable vertex arrays (Note: glInterleavedArrays implicitly called
- // glEnableClientState for vertex, texture coord and color arrays)
- glDisableClientState( GL_VERTEX_ARRAY );
- glDisableClientState( GL_TEXTURE_COORD_ARRAY );
- glDisableClientState( GL_COLOR_ARRAY );
-
- // Disable texturing and blending
- glDisable( GL_TEXTURE_2D );
- glDisable( GL_BLEND );
-
- // Allow Z-buffer updates again
- glDepthMask( GL_TRUE );
-}
-
-
-//========================================================================
-// Fountain geometry specification
-//========================================================================
-
-#define FOUNTAIN_SIDE_POINTS 14
-#define FOUNTAIN_SWEEP_STEPS 32
-
-static const float fountain_side[ FOUNTAIN_SIDE_POINTS*2 ] = {
- 1.2f, 0.0f, 1.0f, 0.2f, 0.41f, 0.3f, 0.4f, 0.35f,
- 0.4f, 1.95f, 0.41f, 2.0f, 0.8f, 2.2f, 1.2f, 2.4f,
- 1.5f, 2.7f, 1.55f,2.95f, 1.6f, 3.0f, 1.0f, 3.0f,
- 0.5f, 3.0f, 0.0f, 3.0f
-};
-
-static const float fountain_normal[ FOUNTAIN_SIDE_POINTS*2 ] = {
- 1.0000f, 0.0000f, 0.6428f, 0.7660f, 0.3420f, 0.9397f, 1.0000f, 0.0000f,
- 1.0000f, 0.0000f, 0.3420f,-0.9397f, 0.4226f,-0.9063f, 0.5000f,-0.8660f,
- 0.7660f,-0.6428f, 0.9063f,-0.4226f, 0.0000f,1.00000f, 0.0000f,1.00000f,
- 0.0000f,1.00000f, 0.0000f,1.00000f
-};
-
-
-//========================================================================
-// DrawFountain() - Draw a fountain
-//========================================================================
-
-void DrawFountain( void )
-{
- static GLuint fountain_list = 0;
- double angle;
- float x, y;
- int m, n;
-
- // The first time, we build the fountain display list
- if( !fountain_list )
- {
- // Start recording of a new display list
- fountain_list = glGenLists( 1 );
- glNewList( fountain_list, GL_COMPILE_AND_EXECUTE );
-
- // Set fountain material
- glMaterialfv( GL_FRONT, GL_DIFFUSE, fountain_diffuse );
- glMaterialfv( GL_FRONT, GL_SPECULAR, fountain_specular );
- glMaterialf( GL_FRONT, GL_SHININESS, fountain_shininess );
-
- // Build fountain using triangle strips
- for( n = 0; n < FOUNTAIN_SIDE_POINTS-1; n ++ )
- {
- glBegin( GL_TRIANGLE_STRIP );
- for( m = 0; m <= FOUNTAIN_SWEEP_STEPS; m ++ )
- {
- angle = (double) m * (2.0*M_PI/(double)FOUNTAIN_SWEEP_STEPS);
- x = (float) cos( angle );
- y = (float) sin( angle );
-
- // Draw triangle strip
- glNormal3f( x * fountain_normal[ n*2+2 ],
- y * fountain_normal[ n*2+2 ],
- fountain_normal[ n*2+3 ] );
- glVertex3f( x * fountain_side[ n*2+2 ],
- y * fountain_side[ n*2+2 ],
- fountain_side[ n*2+3 ] );
- glNormal3f( x * fountain_normal[ n*2 ],
- y * fountain_normal[ n*2 ],
- fountain_normal[ n*2+1 ] );
- glVertex3f( x * fountain_side[ n*2 ],
- y * fountain_side[ n*2 ],
- fountain_side[ n*2+1 ] );
- }
- glEnd();
- }
-
- // End recording of display list
- glEndList();
- }
- else
- {
- // Playback display list
- glCallList( fountain_list );
- }
-}
-
-
-//========================================================================
-// TesselateFloor() - Recursive function for building variable tesselated
-// floor
-//========================================================================
-
-void TesselateFloor( float x1, float y1, float x2, float y2,
- int recursion )
-{
- float delta, x, y;
-
- // Last recursion?
- if( recursion >= 5 )
- {
- delta = 999999.0f;
- }
- else
- {
- x = (float) (fabs(x1) < fabs(x2) ? fabs(x1) : fabs(x2));
- y = (float) (fabs(y1) < fabs(y2) ? fabs(y1) : fabs(y2));
- delta = x*x + y*y;
- }
-
- // Recurse further?
- if( delta < 0.1f )
- {
- x = (x1+x2) * 0.5f;
- y = (y1+y2) * 0.5f;
- TesselateFloor( x1,y1, x, y, recursion + 1 );
- TesselateFloor( x,y1, x2, y, recursion + 1 );
- TesselateFloor( x1, y, x,y2, recursion + 1 );
- TesselateFloor( x, y, x2,y2, recursion + 1 );
- }
- else
- {
- glTexCoord2f( x1*30.0f, y1*30.0f );
- glVertex3f( x1*80.0f, y1*80.0f , 0.0f );
- glTexCoord2f( x2*30.0f, y1*30.0f );
- glVertex3f( x2*80.0f, y1*80.0f , 0.0f );
- glTexCoord2f( x2*30.0f, y2*30.0f );
- glVertex3f( x2*80.0f, y2*80.0f , 0.0f );
- glTexCoord2f( x1*30.0f, y2*30.0f );
- glVertex3f( x1*80.0f, y2*80.0f , 0.0f );
- }
-}
-
-
-//========================================================================
-// DrawFloor() - Draw floor. We builde the floor recursively, and let the
-// tesselation in the centre (near x,y=0,0) be high, while the selleation
-// around the edges be low.
-//========================================================================
-
-void DrawFloor( void )
-{
- static GLuint floor_list = 0;
-
- // Select floor texture
- if( !wireframe )
- {
- glEnable( GL_TEXTURE_2D );
- glBindTexture( GL_TEXTURE_2D, floor_tex_id );
- }
-
- // The first time, we build the floor display list
- if( !floor_list )
- {
- // Start recording of a new display list
- floor_list = glGenLists( 1 );
- glNewList( floor_list, GL_COMPILE_AND_EXECUTE );
-
- // Set floor material
- glMaterialfv( GL_FRONT, GL_DIFFUSE, floor_diffuse );
- glMaterialfv( GL_FRONT, GL_SPECULAR, floor_specular );
- glMaterialf( GL_FRONT, GL_SHININESS, floor_shininess );
-
- // Draw floor as a bunch of triangle strips (high tesselation
- // improves lighting)
- glNormal3f( 0.0f, 0.0f, 1.0f );
- glBegin( GL_QUADS );
- TesselateFloor( -1.0f,-1.0f, 0.0f,0.0f, 0 );
- TesselateFloor( 0.0f,-1.0f, 1.0f,0.0f, 0 );
- TesselateFloor( 0.0f, 0.0f, 1.0f,1.0f, 0 );
- TesselateFloor( -1.0f, 0.0f, 0.0f,1.0f, 0 );
- glEnd();
-
- // End recording of display list
- glEndList();
- }
- else
- {
- // Playback display list
- glCallList( floor_list );
- }
-
- glDisable( GL_TEXTURE_2D );
-
-}
-
-
-//========================================================================
-// SetupLights() - Position and configure light sources
-//========================================================================
-
-void SetupLights( void )
-{
- float l1pos[4], l1amb[4], l1dif[4], l1spec[4];
- float l2pos[4], l2amb[4], l2dif[4], l2spec[4];
-
- // Set light source 1 parameters
- l1pos[0] = 0.0f; l1pos[1] = -9.0f; l1pos[2] = 8.0f; l1pos[3] = 1.0f;
- l1amb[0] = 0.2f; l1amb[1] = 0.2f; l1amb[2] = 0.2f; l1amb[3] = 1.0f;
- l1dif[0] = 0.8f; l1dif[1] = 0.4f; l1dif[2] = 0.2f; l1dif[3] = 1.0f;
- l1spec[0] = 1.0f; l1spec[1] = 0.6f; l1spec[2] = 0.2f; l1spec[3] = 0.0f;
-
- // Set light source 2 parameters
- l2pos[0] = -15.0f; l2pos[1] = 12.0f; l2pos[2] = 1.5f; l2pos[3] = 1.0f;
- l2amb[0] = 0.0f; l2amb[1] = 0.0f; l2amb[2] = 0.0f; l2amb[3] = 1.0f;
- l2dif[0] = 0.2f; l2dif[1] = 0.4f; l2dif[2] = 0.8f; l2dif[3] = 1.0f;
- l2spec[0] = 0.2f; l2spec[1] = 0.6f; l2spec[2] = 1.0f; l2spec[3] = 0.0f;
-
- // Configure light sources in OpenGL
- glLightfv( GL_LIGHT1, GL_POSITION, l1pos );
- glLightfv( GL_LIGHT1, GL_AMBIENT, l1amb );
- glLightfv( GL_LIGHT1, GL_DIFFUSE, l1dif );
- glLightfv( GL_LIGHT1, GL_SPECULAR, l1spec );
- glLightfv( GL_LIGHT2, GL_POSITION, l2pos );
- glLightfv( GL_LIGHT2, GL_AMBIENT, l2amb );
- glLightfv( GL_LIGHT2, GL_DIFFUSE, l2dif );
- glLightfv( GL_LIGHT2, GL_SPECULAR, l2spec );
- glLightfv( GL_LIGHT3, GL_POSITION, glow_pos );
- glLightfv( GL_LIGHT3, GL_DIFFUSE, glow_color );
- glLightfv( GL_LIGHT3, GL_SPECULAR, glow_color );
-
- // Enable light sources
- glEnable( GL_LIGHT1 );
- glEnable( GL_LIGHT2 );
- glEnable( GL_LIGHT3 );
-}
-
-
-//========================================================================
-// Draw() - Main rendering function
-//========================================================================
-
-void Draw( double t )
-{
- double xpos, ypos, zpos, angle_x, angle_y, angle_z;
- static double t_old = 0.0;
- float dt;
-
- // Calculate frame-to-frame delta time
- dt = (float)(t-t_old);
- t_old = t;
-
- // Setup viewport
- glViewport( 0, 0, width, height );
-
- // Clear color and Z-buffer
- glClearColor( 0.1f, 0.1f, 0.1f, 1.0f );
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- // Setup projection
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- gluPerspective( 65.0, (double)width/(double)height, 1.0, 60.0 );
-
- // Setup camera
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
-
- // Rotate camera
- angle_x = 90.0 - 10.0;
- angle_y = 10.0 * sin( 0.3 * t );
- angle_z = 10.0 * t;
- glRotated( -angle_x, 1.0, 0.0, 0.0 );
- glRotated( -angle_y, 0.0, 1.0, 0.0 );
- glRotated( -angle_z, 0.0, 0.0, 1.0 );
-
- // Translate camera
- xpos = 15.0 * sin( (M_PI/180.0) * angle_z ) +
- 2.0 * sin( (M_PI/180.0) * 3.1 * t );
- ypos = -15.0 * cos( (M_PI/180.0) * angle_z ) +
- 2.0 * cos( (M_PI/180.0) * 2.9 * t );
- zpos = 4.0 + 2.0 * cos( (M_PI/180.0) * 4.9 * t );
- glTranslated( -xpos, -ypos, -zpos );
-
- // Enable face culling
- glFrontFace( GL_CCW );
- glCullFace( GL_BACK );
- glEnable( GL_CULL_FACE );
-
- // Enable lighting
- SetupLights();
- glEnable( GL_LIGHTING );
-
- // Enable fog (dim details far away)
- glEnable( GL_FOG );
- glFogi( GL_FOG_MODE, GL_EXP );
- glFogf( GL_FOG_DENSITY, 0.05f );
- glFogfv( GL_FOG_COLOR, fog_color );
-
- // Draw floor
- DrawFloor();
-
- // Enable Z-buffering
- glEnable( GL_DEPTH_TEST );
- glDepthFunc( GL_LEQUAL );
- glDepthMask( GL_TRUE );
-
- // Draw fountain
- DrawFountain();
-
- // Disable fog & lighting
- glDisable( GL_LIGHTING );
- glDisable( GL_FOG );
-
- // Draw all particles (must be drawn after all solid objects have been
- // drawn!)
- DrawParticles( t, dt );
-
- // Z-buffer not needed anymore
- glDisable( GL_DEPTH_TEST );
-}
-
-
-//========================================================================
-// Resize() - GLFW window resize callback function
-//========================================================================
-
-void GLFWCALL Resize( int x, int y )
-{
- width = x;
- height = y > 0 ? y : 1; // Prevent division by zero in aspect calc.
-}
-
-
-//========================================================================
-// Input callback functions
-//========================================================================
-
-void GLFWCALL KeyFun( int key, int action )
-{
- if( action == GLFW_PRESS )
- {
- switch( key )
- {
- case GLFW_KEY_ESC:
- running = 0;
- break;
- case 'W':
- wireframe = !wireframe;
- glPolygonMode( GL_FRONT_AND_BACK,
- wireframe ? GL_LINE : GL_FILL );
- break;
- default:
- break;
- }
- }
-}
-
-
-//========================================================================
-// PhysicsThreadFun() - Thread for updating particle physics
-//========================================================================
-
-void GLFWCALL PhysicsThreadFun( void *arg )
-{
- while( running )
- {
- // Lock mutex
- glfwLockMutex( thread_sync.particles_lock );
-
- // Wait for particle drawing to be done
- while( running && thread_sync.p_frame > thread_sync.d_frame )
- {
- glfwWaitCond( thread_sync.d_done, thread_sync.particles_lock,
- 0.1 );
- }
-
- // No longer running?
- if( !running )
- {
- break;
- }
-
- // Update particles
- ParticleEngine( thread_sync.t, thread_sync.dt );
-
- // Update frame counter
- thread_sync.p_frame ++;
-
- // Unlock mutex and signal drawing thread
- glfwUnlockMutex( thread_sync.particles_lock );
- glfwSignalCond( thread_sync.p_done );
- }
-}
-
-
-//========================================================================
-// main()
-//========================================================================
-
-int main( int argc, char **argv )
-{
- int i, frames, benchmark;
- double t0, t;
- GLFWthread physics_thread = 0;
-
- // Use multithreading by default, but don't benchmark
- multithreading = 1;
- benchmark = 0;
-
- // Check command line arguments
- for( i = 1; i < argc; i ++ )
- {
- // Use benchmarking?
- if( strcmp( argv[i], "-b" ) == 0 )
- {
- benchmark = 1;
- }
-
- // Force multithreading off?
- else if( strcmp( argv[i], "-s" ) == 0 )
- {
- multithreading = 0;
- }
-
- // With a Finder launch on Mac OS X we get a bogus -psn_0_46268417
- // kind of argument (actual numbers vary). Ignore it.
- else if( strncmp( argv[i], "-psn_", 5) == 0 );
-
- // Usage
- else
- {
- if( strcmp( argv[i], "-?" ) != 0 )
- {
- printf( "Unknonwn option %s\n\n", argv[ i ] );
- }
- printf( "Usage: %s [options]\n", argv[ 0 ] );
- printf( "\n");
- printf( "Options:\n" );
- printf( " -b Benchmark (run program for 60 s)\n" );
- printf( " -s Run program as single thread (default is to use two threads)\n" );
- printf( " -? Display this text\n" );
- printf( "\n");
- printf( "Program runtime controls:\n" );
- printf( " w Toggle wireframe mode\n" );
- printf( " ESC Exit program\n" );
- exit( 0 );
- }
- }
-
- // Initialize GLFW
- if( !glfwInit() )
- {
- fprintf( stderr, "Failed to initialize GLFW\n" );
- exit( EXIT_FAILURE );
- }
-
- // Open OpenGL fullscreen window
- if( !glfwCreateWindow( WIDTH, HEIGHT, 0,0,0,0, 16,0, GLFW_FULLSCREEN ) )
- {
- fprintf( stderr, "Failed to open GLFW window\n" );
- glfwTerminate();
- exit( EXIT_FAILURE );
- }
-
- // Set window title
- glfwSetWindowTitle( "Particle engine" );
-
- // Disable VSync (we want to get as high FPS as possible!)
- glfwSwapInterval( 0 );
-
- // Window resize callback function
- glfwSetWindowSizeCallback( Resize );
-
- // Set keyboard input callback function
- glfwSetKeyCallback( KeyFun );
-
- // Upload particle texture
- glGenTextures( 1, &particle_tex_id );
- glBindTexture( GL_TEXTURE_2D, particle_tex_id );
- glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
- glTexImage2D( GL_TEXTURE_2D, 0, GL_LUMINANCE, P_TEX_WIDTH, P_TEX_HEIGHT,
- 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, particle_texture );
-
- // Upload floor texture
- glGenTextures( 1, &floor_tex_id );
- glBindTexture( GL_TEXTURE_2D, floor_tex_id );
- glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
- glTexImage2D( GL_TEXTURE_2D, 0, GL_LUMINANCE, F_TEX_WIDTH, F_TEX_HEIGHT,
- 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, floor_texture );
-
- // Check if we have GL_EXT_separate_specular_color, and if so use it
- if( glfwExtensionSupported( "GL_EXT_separate_specular_color" ) )
- {
- glLightModeli( GL_LIGHT_MODEL_COLOR_CONTROL_EXT,
- GL_SEPARATE_SPECULAR_COLOR_EXT );
- }
-
- // Set filled polygon mode as default (not wireframe)
- glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
- wireframe = 0;
-
- // Clear particle system
- for( i = 0; i < MAX_PARTICLES; i ++ )
- {
- particles[ i ].active = 0;
- }
- min_age = 0.0f;
-
- // Set "running" flag
- running = 1;
-
- // Set initial times
- thread_sync.t = 0.0;
- thread_sync.dt = 0.001f;
-
- // Init threading
- if( multithreading )
- {
- thread_sync.p_frame = 0;
- thread_sync.d_frame = 0;
- thread_sync.particles_lock = glfwCreateMutex();
- thread_sync.p_done = glfwCreateCond();
- thread_sync.d_done = glfwCreateCond();
- physics_thread = glfwCreateThread( PhysicsThreadFun, NULL );
- }
-
- // Main loop
- t0 = glfwGetTime();
- frames = 0;
- while( running )
- {
- // Get frame time
- t = glfwGetTime() - t0;
-
- // Draw...
- Draw( t );
-
- // Swap buffers
- glfwSwapBuffers();
-
- // Check if window was closed
- running = running && glfwGetWindowParam( GLFW_OPENED );
-
- // Increase frame count
- frames ++;
-
- // End of benchmark?
- if( benchmark && t >= 60.0 )
- {
- running = 0;
- }
- }
- t = glfwGetTime() - t0;
-
- // Wait for particle physics thread to die
- if( multithreading )
- {
- glfwWaitThread( physics_thread, GLFW_WAIT );
- }
-
- // Display profiling information
- printf( "%d frames in %.2f seconds = %.1f FPS", frames, t,
- (double)frames / t );
- printf( " (multithreading %s)\n", multithreading ? "on" : "off" );
-
- // Terminate OpenGL
- glfwTerminate();
-
- exit( EXIT_SUCCESS );
-}
-
diff --git a/examples/pong3d.c b/examples/pong3d.c
deleted file mode 100644
index 58c9ee20..00000000
--- a/examples/pong3d.c
+++ /dev/null
@@ -1,854 +0,0 @@
-//========================================================================
-// This is a small test application for GLFW.
-// This is an OpenGL port of the famous "PONG" game (the first computer
-// game ever?). It is very simple, and could be improved alot. It was
-// created in order to show off the gaming capabilities of GLFW.
-//========================================================================
-
-#include
-#include
-#include
-#include
-
-
-//========================================================================
-// Constants
-//========================================================================
-
-// Screen resolution
-#define WIDTH 640
-#define HEIGHT 480
-
-// Player size (units)
-#define PLAYER_XSIZE 0.05f
-#define PLAYER_YSIZE 0.15f
-
-// Ball size (units)
-#define BALL_SIZE 0.02f
-
-// Maximum player movement speed (units / second)
-#define MAX_SPEED 1.5f
-
-// Player movement acceleration (units / seconds^2)
-#define ACCELERATION 4.0f
-
-// Player movement deceleration (units / seconds^2)
-#define DECELERATION 2.0f
-
-// Ball movement speed (units / second)
-#define BALL_SPEED 0.4f
-
-// Menu options
-#define MENU_NONE 0
-#define MENU_PLAY 1
-#define MENU_QUIT 2
-
-// Game events
-#define NOBODY_WINS 0
-#define PLAYER1_WINS 1
-#define PLAYER2_WINS 2
-
-// Winner ID
-#define NOBODY 0
-#define PLAYER1 1
-#define PLAYER2 2
-
-// Camera positions
-#define CAMERA_CLASSIC 0
-#define CAMERA_ABOVE 1
-#define CAMERA_SPECTATOR 2
-#define CAMERA_DEFAULT CAMERA_CLASSIC
-
-
-//========================================================================
-// Textures
-//========================================================================
-
-#define TEX_TITLE 0
-#define TEX_MENU 1
-#define TEX_INSTR 2
-#define TEX_WINNER1 3
-#define TEX_WINNER2 4
-#define TEX_FIELD 5
-#define NUM_TEXTURES 6
-
-// Texture names
-char * tex_name[ NUM_TEXTURES ] = {
- "pong3d_title.tga",
- "pong3d_menu.tga",
- "pong3d_instr.tga",
- "pong3d_winner1.tga",
- "pong3d_winner2.tga",
- "pong3d_field.tga"
-};
-
-// OpenGL texture object IDs
-GLuint tex_id[ NUM_TEXTURES ];
-
-
-//========================================================================
-// Global variables
-//========================================================================
-
-// Display information
-int width, height;
-
-// Frame information
-double thistime, oldtime, dt, starttime;
-
-// Camera information
-int camerapos;
-
-// Player information
-struct {
- double ypos; // -1.0 to +1.0
- double yspeed; // -MAX_SPEED to +MAX_SPEED
-} player1, player2;
-
-// Ball information
-struct {
- double xpos, ypos;
- double xspeed, yspeed;
-} ball;
-
-// And the winner is...
-int winner;
-
-// Lighting configuration
-const GLfloat env_ambient[4] = {1.0f,1.0f,1.0f,1.0f};
-const GLfloat light1_position[4] = {-3.0f,3.0f,2.0f,1.0f};
-const GLfloat light1_diffuse[4] = {1.0f,1.0f,1.0f,0.0f};
-const GLfloat light1_ambient[4] = {0.0f,0.0f,0.0f,0.0f};
-
-// Object material properties
-const GLfloat player1_diffuse[4] = {1.0f,0.3f,0.3f,1.0f};
-const GLfloat player1_ambient[4] = {0.3f,0.1f,0.0f,1.0f};
-const GLfloat player2_diffuse[4] = {0.3f,1.0f,0.3f,1.0f};
-const GLfloat player2_ambient[4] = {0.1f,0.3f,0.1f,1.0f};
-const GLfloat ball_diffuse[4] = {1.0f,1.0f,0.5f,1.0f};
-const GLfloat ball_ambient[4] = {0.3f,0.3f,0.1f,1.0f};
-const GLfloat border_diffuse[4] = {0.3f,0.3f,1.0f,1.0f};
-const GLfloat border_ambient[4] = {0.1f,0.1f,0.3f,1.0f};
-const GLfloat floor_diffuse[4] = {1.0f,1.0f,1.0f,1.0f};
-const GLfloat floor_ambient[4] = {0.3f,0.3f,0.3f,1.0f};
-
-
-//========================================================================
-// LoadTextures() - Load textures from disk and upload to OpenGL card
-//========================================================================
-
-GLboolean LoadTextures( void )
-{
- int i;
-
- // Generate texture objects
- glGenTextures( NUM_TEXTURES, tex_id );
-
- // Load textures
- for( i = 0; i < NUM_TEXTURES; i ++ )
- {
- // Select texture object
- glBindTexture( GL_TEXTURE_2D, tex_id[ i ] );
-
- // Set texture parameters
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
-
- // Upload texture from file to texture memory
- if( !glfwLoadTexture2D( tex_name[ i ], 0 ) )
- {
- fprintf( stderr, "Failed to load texture %s\n", tex_name[ i ] );
- return GL_FALSE;
- }
- }
-
- return GL_TRUE;
-}
-
-
-//========================================================================
-// DrawImage() - Draw a 2D image as a texture
-//========================================================================
-
-void DrawImage( int texnum, float x1, float x2, float y1, float y2 )
-{
- glEnable( GL_TEXTURE_2D );
- glBindTexture( GL_TEXTURE_2D, tex_id[ texnum ] );
- glBegin( GL_QUADS );
- glTexCoord2f( 0.0f, 1.0f );
- glVertex2f( x1, y1 );
- glTexCoord2f( 1.0f, 1.0f );
- glVertex2f( x2, y1 );
- glTexCoord2f( 1.0f, 0.0f );
- glVertex2f( x2, y2 );
- glTexCoord2f( 0.0f, 0.0f );
- glVertex2f( x1, y2 );
- glEnd();
- glDisable( GL_TEXTURE_2D );
-}
-
-
-//========================================================================
-// GameMenu() - Game menu (returns menu option)
-//========================================================================
-
-int GameMenu( void )
-{
- int option;
-
- // Enable sticky keys
- glfwEnable( GLFW_STICKY_KEYS );
-
- // Wait for a game menu key to be pressed
- do
- {
- // Get window size
- glfwGetWindowSize( &width, &height );
-
- // Set viewport
- glViewport( 0, 0, width, height );
-
- // Clear display
- glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
- glClear( GL_COLOR_BUFFER_BIT );
-
- // Setup projection matrix
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho( 0.0f, 1.0f, 1.0f, 0.0f, -1.0f, 1.0f );
-
- // Setup modelview matrix
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
-
- // Display title
- glColor3f( 1.0f, 1.0f, 1.0f );
- DrawImage( TEX_TITLE, 0.1f, 0.9f, 0.0f, 0.3f );
-
- // Display menu
- glColor3f( 1.0f, 1.0f, 0.0f );
- DrawImage( TEX_MENU, 0.38f, 0.62f, 0.35f, 0.5f );
-
- // Display instructions
- glColor3f( 0.0f, 1.0f, 1.0f );
- DrawImage( TEX_INSTR, 0.32f, 0.68f, 0.65f, 0.85f );
-
- // Swap buffers
- glfwSwapBuffers();
-
- // Check for keys
- if( glfwGetKey( 'Q' ) || !glfwGetWindowParam( GLFW_OPENED ) )
- {
- option = MENU_QUIT;
- }
- else if( glfwGetKey( GLFW_KEY_F1 ) )
- {
- option = MENU_PLAY;
- }
- else
- {
- option = MENU_NONE;
- }
-
- // To avoid horrible busy waiting, sleep for at least 20 ms
- glfwSleep( 0.02 );
- }
- while( option == MENU_NONE );
-
- // Disable sticky keys
- glfwDisable( GLFW_STICKY_KEYS );
-
- return option;
-}
-
-
-//========================================================================
-// NewGame() - Initialize a new game
-//========================================================================
-
-void NewGame( void )
-{
- // Frame information
- starttime = thistime = glfwGetTime();
-
- // Camera information
- camerapos = CAMERA_DEFAULT;
-
- // Player 1 information
- player1.ypos = 0.0;
- player1.yspeed = 0.0;
-
- // Player 2 information
- player2.ypos = 0.0;
- player2.yspeed = 0.0;
-
- // Ball information
- ball.xpos = -1.0 + PLAYER_XSIZE;
- ball.ypos = player1.ypos;
- ball.xspeed = 1.0;
- ball.yspeed = 1.0;
-}
-
-
-//========================================================================
-// PlayerControl() - Player control
-//========================================================================
-
-void PlayerControl( void )
-{
- float joy1pos[ 2 ], joy2pos[ 2 ];
-
- // Get joystick X & Y axis positions
- glfwGetJoystickPos( GLFW_JOYSTICK_1, joy1pos, 2 );
- glfwGetJoystickPos( GLFW_JOYSTICK_2, joy2pos, 2 );
-
- // Player 1 control
- if( glfwGetKey( 'A' ) || joy1pos[ 1 ] > 0.2f )
- {
- player1.yspeed += dt * ACCELERATION;
- if( player1.yspeed > MAX_SPEED )
- {
- player1.yspeed = MAX_SPEED;
- }
- }
- else if( glfwGetKey( 'Z' ) || joy1pos[ 1 ] < -0.2f )
- {
- player1.yspeed -= dt * ACCELERATION;
- if( player1.yspeed < -MAX_SPEED )
- {
- player1.yspeed = -MAX_SPEED;
- }
- }
- else
- {
- player1.yspeed /= exp( DECELERATION * dt );
- }
-
- // Player 2 control
- if( glfwGetKey( 'K' ) || joy2pos[ 1 ] > 0.2f )
- {
- player2.yspeed += dt * ACCELERATION;
- if( player2.yspeed > MAX_SPEED )
- {
- player2.yspeed = MAX_SPEED;
- }
- }
- else if( glfwGetKey( 'M' ) || joy2pos[ 1 ] < -0.2f )
- {
- player2.yspeed -= dt * ACCELERATION;
- if( player2.yspeed < -MAX_SPEED )
- {
- player2.yspeed = -MAX_SPEED;
- }
- }
- else
- {
- player2.yspeed /= exp( DECELERATION * dt );
- }
-
- // Update player 1 position
- player1.ypos += dt * player1.yspeed;
- if( player1.ypos > 1.0 - PLAYER_YSIZE )
- {
- player1.ypos = 1.0 - PLAYER_YSIZE;
- player1.yspeed = 0.0;
- }
- else if( player1.ypos < -1.0 + PLAYER_YSIZE )
- {
- player1.ypos = -1.0 + PLAYER_YSIZE;
- player1.yspeed = 0.0;
- }
-
- // Update player 2 position
- player2.ypos += dt * player2.yspeed;
- if( player2.ypos > 1.0 - PLAYER_YSIZE )
- {
- player2.ypos = 1.0 - PLAYER_YSIZE;
- player2.yspeed = 0.0;
- }
- else if( player2.ypos < -1.0 + PLAYER_YSIZE )
- {
- player2.ypos = -1.0 + PLAYER_YSIZE;
- player2.yspeed = 0.0;
- }
-}
-
-
-//========================================================================
-// BallControl() - Ball control
-//========================================================================
-
-int BallControl( void )
-{
- int event;
- double ballspeed;
-
- // Calculate new ball speed
- ballspeed = BALL_SPEED * (1.0 + 0.02*(thistime-starttime));
- ball.xspeed = ball.xspeed > 0 ? ballspeed : -ballspeed;
- ball.yspeed = ball.yspeed > 0 ? ballspeed : -ballspeed;
- ball.yspeed *= 0.74321;
-
- // Update ball position
- ball.xpos += dt * ball.xspeed;
- ball.ypos += dt * ball.yspeed;
-
- // Did the ball hit a top/bottom wall?
- if( ball.ypos >= 1.0 )
- {
- ball.ypos = 2.0 - ball.ypos;
- ball.yspeed = -ball.yspeed;
- }
- else if( ball.ypos <= -1.0 )
- {
- ball.ypos = -2.0 - ball.ypos;
- ball.yspeed = -ball.yspeed;
- }
-
- // Did the ball hit/miss a player?
- event = NOBODY_WINS;
-
- // Is the ball entering the player 1 goal?
- if( ball.xpos < -1.0 + PLAYER_XSIZE )
- {
- // Did player 1 catch the ball?
- if( ball.ypos > (player1.ypos-PLAYER_YSIZE) &&
- ball.ypos < (player1.ypos+PLAYER_YSIZE) )
- {
- ball.xpos = -2.0 + 2.0*PLAYER_XSIZE - ball.xpos;
- ball.xspeed = -ball.xspeed;
- }
- else
- {
- event = PLAYER2_WINS;
- }
- }
-
- // Is the ball entering the player 2 goal?
- if( ball.xpos > 1.0 - PLAYER_XSIZE )
- {
- // Did player 2 catch the ball?
- if( ball.ypos > (player2.ypos-PLAYER_YSIZE) &&
- ball.ypos < (player2.ypos+PLAYER_YSIZE) )
- {
- ball.xpos = 2.0 - 2.0*PLAYER_XSIZE - ball.xpos;
- ball.xspeed = -ball.xspeed;
- }
- else
- {
- event = PLAYER1_WINS;
- }
- }
-
- return event;
-}
-
-
-//========================================================================
-// DrawBox() - Draw a 3D box
-//========================================================================
-
-#define TEX_SCALE 4.0f
-
-
-void DrawBox( float x1, float y1, float z1, float x2, float y2, float z2 )
-{
- // Draw six sides of a cube
- glBegin( GL_QUADS );
- // Side 1 (down)
- glNormal3f( 0.0f, 0.0f, -1.0f );
- glTexCoord2f( 0.0f, 0.0f );
- glVertex3f( x1,y2,z1 );
- glTexCoord2f( TEX_SCALE, 0.0f );
- glVertex3f( x2,y2,z1 );
- glTexCoord2f( TEX_SCALE, TEX_SCALE );
- glVertex3f( x2,y1,z1 );
- glTexCoord2f( 0.0f, TEX_SCALE );
- glVertex3f( x1,y1,z1 );
- // Side 2 (up)
- glNormal3f( 0.0f, 0.0f, 1.0f );
- glTexCoord2f( 0.0f, 0.0f );
- glVertex3f( x1,y1,z2 );
- glTexCoord2f( TEX_SCALE, 0.0f );
- glVertex3f( x2,y1,z2 );
- glTexCoord2f( TEX_SCALE, TEX_SCALE );
- glVertex3f( x2,y2,z2 );
- glTexCoord2f( 0.0f, TEX_SCALE );
- glVertex3f( x1,y2,z2 );
- // Side 3 (backward)
- glNormal3f( 0.0f, -1.0f, 0.0f );
- glTexCoord2f( 0.0f, 0.0f );
- glVertex3f( x1,y1,z1 );
- glTexCoord2f( TEX_SCALE, 0.0f );
- glVertex3f( x2,y1,z1 );
- glTexCoord2f( TEX_SCALE, TEX_SCALE );
- glVertex3f( x2,y1,z2 );
- glTexCoord2f( 0.0f, TEX_SCALE );
- glVertex3f( x1,y1,z2 );
- // Side 4 (forward)
- glNormal3f( 0.0f, 1.0f, 0.0f );
- glTexCoord2f( 0.0f, 0.0f );
- glVertex3f( x1,y2,z2 );
- glTexCoord2f( TEX_SCALE, 0.0f );
- glVertex3f( x2,y2,z2 );
- glTexCoord2f( TEX_SCALE, TEX_SCALE );
- glVertex3f( x2,y2,z1 );
- glTexCoord2f( 0.0f, TEX_SCALE );
- glVertex3f( x1,y2,z1 );
- // Side 5 (left)
- glNormal3f( -1.0f, 0.0f, 0.0f );
- glTexCoord2f( 0.0f, 0.0f );
- glVertex3f( x1,y1,z2 );
- glTexCoord2f( TEX_SCALE, 0.0f );
- glVertex3f( x1,y2,z2 );
- glTexCoord2f( TEX_SCALE, TEX_SCALE );
- glVertex3f( x1,y2,z1 );
- glTexCoord2f( 0.0f, TEX_SCALE );
- glVertex3f( x1,y1,z1 );
- // Side 6 (right)
- glNormal3f( 1.0f, 0.0f, 0.0f );
- glTexCoord2f( 0.0f, 0.0f );
- glVertex3f( x2,y1,z1 );
- glTexCoord2f( TEX_SCALE, 0.0f );
- glVertex3f( x2,y2,z1 );
- glTexCoord2f( TEX_SCALE, TEX_SCALE );
- glVertex3f( x2,y2,z2 );
- glTexCoord2f( 0.0f, TEX_SCALE );
- glVertex3f( x2,y1,z2 );
- glEnd();
-}
-
-
-//========================================================================
-// UpdateDisplay() - Draw graphics (all game related OpenGL stuff goes
-// here)
-//========================================================================
-
-void UpdateDisplay( void )
-{
- // Get window size
- glfwGetWindowSize( &width, &height );
-
- // Set viewport
- glViewport( 0, 0, width, height );
-
- // Clear display
- glClearColor( 0.02f, 0.02f, 0.02f, 0.0f );
- glClearDepth( 1.0f );
- glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
- // Setup projection matrix
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- gluPerspective(
- 55.0f, // Angle of view
- (GLfloat)width/(GLfloat)height, // Aspect
- 1.0f, // Near Z
- 100.0f // Far Z
- );
-
- // Setup modelview matrix
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
- switch( camerapos )
- {
- default:
- case CAMERA_CLASSIC:
- gluLookAt(
- 0.0f, 0.0f, 2.5f,
- 0.0f, 0.0f, 0.0f,
- 0.0f, 1.0f, 0.0f
- );
- break;
- case CAMERA_ABOVE:
- gluLookAt(
- 0.0f, 0.0f, 2.5f,
- (float)ball.xpos, (float)ball.ypos, 0.0f,
- 0.0f, 1.0f, 0.0f
- );
- break;
- case CAMERA_SPECTATOR:
- gluLookAt(
- 0.0f, -2.0, 1.2f,
- (float)ball.xpos, (float)ball.ypos, 0.0f,
- 0.0f, 0.0f, 1.0f
- );
- break;
- }
-
- // Enable depth testing
- glEnable( GL_DEPTH_TEST );
- glDepthFunc( GL_LEQUAL );
-
- // Enable lighting
- glEnable( GL_LIGHTING );
- glLightModelfv( GL_LIGHT_MODEL_AMBIENT, env_ambient );
- glLightModeli( GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE );
- glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE );
- glLightfv( GL_LIGHT1, GL_POSITION, light1_position );
- glLightfv( GL_LIGHT1, GL_DIFFUSE, light1_diffuse );
- glLightfv( GL_LIGHT1, GL_AMBIENT, light1_ambient );
- glEnable( GL_LIGHT1 );
-
- // Front face is counter-clock-wise
- glFrontFace( GL_CCW );
-
- // Enable face culling (not necessary, but speeds up rendering)
- glCullFace( GL_BACK );
- glEnable( GL_CULL_FACE );
-
- // Draw Player 1
- glMaterialfv( GL_FRONT, GL_DIFFUSE, player1_diffuse );
- glMaterialfv( GL_FRONT, GL_AMBIENT, player1_ambient );
- DrawBox( -1.f, (GLfloat)player1.ypos-PLAYER_YSIZE, 0.f,
- -1.f+PLAYER_XSIZE, (GLfloat)player1.ypos+PLAYER_YSIZE, 0.1f );
-
- // Draw Player 2
- glMaterialfv( GL_FRONT, GL_DIFFUSE, player2_diffuse );
- glMaterialfv( GL_FRONT, GL_AMBIENT, player2_ambient );
- DrawBox( 1.f-PLAYER_XSIZE, (GLfloat)player2.ypos-PLAYER_YSIZE, 0.f,
- 1.f, (GLfloat)player2.ypos+PLAYER_YSIZE, 0.1f );
-
- // Draw Ball
- glMaterialfv( GL_FRONT, GL_DIFFUSE, ball_diffuse );
- glMaterialfv( GL_FRONT, GL_AMBIENT, ball_ambient );
- DrawBox( (GLfloat)ball.xpos-BALL_SIZE, (GLfloat)ball.ypos-BALL_SIZE, 0.f,
- (GLfloat)ball.xpos+BALL_SIZE, (GLfloat)ball.ypos+BALL_SIZE, BALL_SIZE*2 );
-
- // Top game field border
- glMaterialfv( GL_FRONT, GL_DIFFUSE, border_diffuse );
- glMaterialfv( GL_FRONT, GL_AMBIENT, border_ambient );
- DrawBox( -1.1f, 1.0f, 0.0f, 1.1f, 1.1f, 0.1f );
- // Bottom game field border
- glColor3f( 0.0f, 0.0f, 0.7f );
- DrawBox( -1.1f, -1.1f, 0.0f, 1.1f, -1.0f, 0.1f );
- // Left game field border
- DrawBox( -1.1f, -1.0f, 0.0f, -1.0f, 1.0f, 0.1f );
- // Left game field border
- DrawBox( 1.0f, -1.0f, 0.0f, 1.1f, 1.0f, 0.1f );
-
- // Enable texturing
- glEnable( GL_TEXTURE_2D );
- glBindTexture( GL_TEXTURE_2D, tex_id[ TEX_FIELD ] );
-
- // Game field floor
- glMaterialfv( GL_FRONT, GL_DIFFUSE, floor_diffuse );
- glMaterialfv( GL_FRONT, GL_AMBIENT, floor_ambient );
- DrawBox( -1.01f, -1.01f, -0.01f, 1.01f, 1.01f, 0.0f );
-
- // Disable texturing
- glDisable( GL_TEXTURE_2D );
-
- // Disable face culling
- glDisable( GL_CULL_FACE );
-
- // Disable lighting
- glDisable( GL_LIGHTING );
-
- // Disable depth testing
- glDisable( GL_DEPTH_TEST );
-}
-
-
-//========================================================================
-// GameOver()
-//========================================================================
-
-void GameOver( void )
-{
- // Enable sticky keys
- glfwEnable( GLFW_STICKY_KEYS );
-
- // Until the user presses ESC or SPACE
- while( !glfwGetKey( GLFW_KEY_ESC ) && !glfwGetKey( ' ' ) &&
- glfwGetWindowParam( GLFW_OPENED ) )
- {
- // Draw display
- UpdateDisplay();
-
- // Setup projection matrix
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glOrtho( 0.0f, 1.0f, 1.0f, 0.0f, -1.0f, 1.0f );
-
- // Setup modelview matrix
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
-
- // Enable blending
- glEnable( GL_BLEND );
-
- // Dim background
- glBlendFunc( GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA );
- glColor4f( 0.3f, 0.3f, 0.3f, 0.3f );
- glBegin( GL_QUADS );
- glVertex2f( 0.0f, 0.0f );
- glVertex2f( 1.0f, 0.0f );
- glVertex2f( 1.0f, 1.0f );
- glVertex2f( 0.0f, 1.0f );
- glEnd();
-
- // Display winner text
- glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_COLOR );
- if( winner == PLAYER1 )
- {
- glColor4f( 1.0f, 0.5f, 0.5f, 1.0f );
- DrawImage( TEX_WINNER1, 0.35f, 0.65f, 0.46f, 0.54f );
- }
- else if( winner == PLAYER2 )
- {
- glColor4f( 0.5f, 1.0f, 0.5f, 1.0f );
- DrawImage( TEX_WINNER2, 0.35f, 0.65f, 0.46f, 0.54f );
- }
-
- // Disable blending
- glDisable( GL_BLEND );
-
- // Swap buffers
- glfwSwapBuffers();
- }
-
- // Disable sticky keys
- glfwDisable( GLFW_STICKY_KEYS );
-}
-
-
-//========================================================================
-// GameLoop() - Game loop
-//========================================================================
-
-void GameLoop( void )
-{
- int playing, event;
-
- // Initialize a new game
- NewGame();
-
- // Enable sticky keys
- glfwEnable( GLFW_STICKY_KEYS );
-
- // Loop until the game ends
- playing = GL_TRUE;
- while( playing && glfwGetWindowParam( GLFW_OPENED ) )
- {
- // Frame timer
- oldtime = thistime;
- thistime = glfwGetTime();
- dt = thistime - oldtime;
-
- // Get user input and update player positions
- PlayerControl();
-
- // Move the ball, and check if a player hits/misses the ball
- event = BallControl();
-
- // Did we have a winner?
- switch( event )
- {
- case PLAYER1_WINS:
- winner = PLAYER1;
- playing = GL_FALSE;
- break;
- case PLAYER2_WINS:
- winner = PLAYER2;
- playing = GL_FALSE;
- break;
- default:
- break;
- }
-
- // Did the user press ESC?
- if( glfwGetKey( GLFW_KEY_ESC ) )
- {
- playing = GL_FALSE;
- }
-
- // Did the user change camera view?
- if( glfwGetKey( '1' ) )
- {
- camerapos = CAMERA_CLASSIC;
- }
- else if( glfwGetKey( '2' ) )
- {
- camerapos = CAMERA_ABOVE;
- }
- else if( glfwGetKey( '3' ) )
- {
- camerapos = CAMERA_SPECTATOR;
- }
-
- // Draw display
- UpdateDisplay();
-
- // Swap buffers
- glfwSwapBuffers();
- }
-
- // Disable sticky keys
- glfwDisable( GLFW_STICKY_KEYS );
-
- // Show winner
- GameOver();
-}
-
-
-//========================================================================
-// main() - Program entry point
-//========================================================================
-
-int main( void )
-{
- int menuoption;
-
- // Initialize GLFW
- if( !glfwInit() )
- {
- fprintf( stderr, "Failed to initialize GLFW\n" );
- exit( EXIT_FAILURE );
- }
-
- // Open OpenGL window
- if( !glfwCreateWindow( WIDTH, HEIGHT, 0,0,0,0, 16,0, GLFW_FULLSCREEN ) )
- {
- fprintf( stderr, "Failed to open GLFW window\n" );
- glfwTerminate();
- exit( EXIT_FAILURE );
- }
-
- glfwSwapInterval( 1 );
-
- // Load all textures
- if( !LoadTextures() )
- {
- glfwTerminate();
- exit( EXIT_FAILURE );
- }
-
- // Main loop
- do
- {
- // Get menu option
- menuoption = GameMenu();
-
- // If the user wants to play, let him...
- if( menuoption == MENU_PLAY )
- {
- GameLoop();
- }
- }
- while( menuoption != MENU_QUIT );
-
- // Unload all textures
- if( glfwGetWindowParam( GLFW_OPENED ) )
- {
- glDeleteTextures( NUM_TEXTURES, tex_id );
- }
-
- // Terminate GLFW
- glfwTerminate();
-
- exit( EXIT_SUCCESS );
-}
-
diff --git a/examples/pong3d_field.tga b/examples/pong3d_field.tga
deleted file mode 100644
index cc20bbdb82434faa3bbc01d27fd199d5214c8b2f..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 17816
zcmX|}e{dV;dFN%NMs0SHI?kkP%2AbGdCn*k0V?F{xhdB=r)t{su}NjqHbo+iD6^KR
zvTiF8>zcy>XAvHxn34|yB_~ak&?{qiY6r*cVu%X?wHYn1v^cp+T<(I>0%TW_F6ytp
z?q>Su&E!50l)L2*QzWqO^FHtMXV0F
z9-Myn@}bu!Ca0#eua8Z>J^S>R4viIN2Zyug>}vLni7|b0;EjnxuVxQDKQR0DxpVJc
zoGeUFyfHbJpZxr@{e!QM4Iay8U!TmrF+ISo$`|{;JaE~rPUw>py!d;UXNwo7-<}=d
z?Jo>W7S8p{&Ckv9vM(OW=FiQ3?{fClv9UKM2Kjt_^64-1XIbv`vFZHm*z045ULKpA
zIyX2xaj~{Erq52~C!c=y(BQF&vDYUDULLz#Tbj^kFMjXxz^fDeUm6^IV>+wP4!l13
z`7iX(BIMf_FWS{ZU(U|HbNSr6mFdFl#Hrb_H>RiGzBus0;B?{KMB&__;lauLboS)f
zL}7aH)ok|E#Msp2p<@$=zC1Ad&bf(GlY=M628IVGrX~lDW&58$bgq1H?9{{{pC>1?
z{PN`3(_b8@EG~WiH~S~wIrsGQ1BZ@{o%{CX$>Qu-el~k-EPHaY|AoPGSE|$RoICVF
zcC5&*2WPKT#!gO5(^0^PI*;CV(
zKdep`k#lS^e{S$q#G4%$9-H9%v5EfY2M140XZiW$3=C%{rltpujrBi2aISoL49$!3+1>QO$%)VZ=ArD#>8CN6W0PYir!RiEGj-UPOj-NfZ<7Yc|{LI<$*ufqD`&V{6j)k8o{KCqP>Ob%JKX2}M^Iv!D
z_~DKn|Fq+iZ|>MJaQV@P{@2GIdHgY6vul?%7baIT$&=Y+GE9Y*6~?Q!ZC_|{*yH6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o=&0juc
z&)KU{xH_}(-KREMJU@t6pkC2}l=FZ<89i_TuZ$^QeZPNGuj>rN1il~C+MPie#jmwl
zn*b~{w^GtN#UH$8q{@Y*tr~f?rU=xl81QiGdGd3WK9`w#pOtFD=CNvRjeh)ixd`VhD9?;0ahM=Zhd@
z4w{Sn1bv~J@eD+G(i)0<9vqdYVbYGOhAo;%i+AsQ^P7Kt`Wye@w>~z>qn$ioYA<%=
zARz3Hij@(@NLngUwM)I?(L9slE=*nRZ*+=4G#7Jdd)J9ZL~U>a-M!*`$Cjgo!lmUb
z!~w$l@?2(Bn21$rtdGD$H2NHcnv;&gx4!keZx8PYmtN~PmEuvP`K)9eA
zBBb)dLi_#xVBTXwjHh>ns74s_pcb?P$1Bo;vSBdz|2BZry{_UKR_FBjjhUH6R1Y)C
T6XevNs>&3`i95eA{_g(;MdbFK
diff --git a/examples/pong3d_instr.tga b/examples/pong3d_instr.tga
deleted file mode 100644
index 758eb447a97187cef812cb9100aa94631954c256..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 21279
zcmeHP2Rzl?8-Hw~u1JaYUN7zOrunvumiCagw6_K-?eS|Wl1eG+&3!AgpOA8k(A#T3TA#+S)ogI;BdL($&?~)6*+mx^$T`Wds6&zP^6hvSken3=9no
z%atoRYdx^?T-t5?5%{RRyhG;G+gQKLqG{PBmGnVGq{dE>^7n>1PN7A;%0Y}Kk&>(;H?v}yC_pMSP(+t$LuqFuXo?c2BS(4j-ejvYI7>eRV&
z=fD2?t4o(IUAuPe)~#Fj?%jLz=+U!h&tAQH_3qufPoF-PmX=mlR(<>S?bokg|Ni|4
z3>YwQ;6Q6@>p_DC4IVsr$dDmJhYlS!Y}oMO!$*u5F>>U{QKLqU9zEK|#%9czF}Ak0
zW5&6LI($jMT-_KUc7k8k|j%*E_HNtbaHZXc6MI2
zY}xYV%U7&e;o{=5a^=cZt5&UEy?V`>HEY+dUAJ!C`t|EKY}l}I&OZQHkR-?3wdtE=nIojZ5!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=<|#q$$uh{r4yt4LRc1>f4cyfYNsXJv%Ek^bW^Kp6srtRrwn@wPGi~$
zx{2517W>}>73sd{U4TS#$SPZ`WbG6L(;(I*FDmRii5|Q0yN9}jPQ|M=`lgF3L*)!{
zCHg-DUBE2K9-Poct$rqkob{9n6f3CW&zX;cV1ko4KQjl32D$+52$IG&@;#<3f!cwg
zVeVib5?mWf4OxWNdYaje8(5fvMq$kHe{|08Ukt+fEAFs>jq5uE@
diff --git a/examples/pong3d_menu.tga b/examples/pong3d_menu.tga
deleted file mode 100644
index d0d6c5a431687bfd6442e43c3878a9eb905c48b8..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 1835
zcmbVMTawc-5FFd7KrLK{i*bQLe#C)-km6&1*q~+M0-Qi+$_YgGjAbh+zSu1}vefFC
z>1kQyjg-Il@=jjMRenoIj~IXChe+&m7gLVsZQ6^Zkej3-2jP$yvZRY#urXlCQ#Jn=lGQ*?msDM%?fom_#3D0WLYd>|
zrM8HEH4zdvDSlgLUu?J06w%uHU$F5BH?%^)6{nIMA=d
zk04{L6gsNXLvPU$y7bcLR=F~R;{Yz~AoE6761IR~EZy-Sc90#?@jjEKjdZ2xgd?t2
zqtTm)Fw3kYxE=nmQqN{37J-&5_=7y4JqUx5<790bksq4`P6Xm?W2J#gsv94$c80Ep
zhB(C(Tcv$%4nwfg>5lD?ncV@L-j6_|Q=WiD2HsmBQ7_k*Bwh}mIAS5_(&Zv)0+JQ*BV=)qzNL$W#l<{{t=av1
zh6fQJ3*Rf(fcY7y8DcVufs`P8r)X65U6x`6n^qTRM5LcL_vtFnz@hK-l+BKK+wK>L@83So!V-2z3xXZm}7`ZB*l$gvAC5tvMEd)H$-L
j=(lM?g-Vm}Fwx!OsnJ{IV_$0Jn){}t&ktU$$5s9UqXSX}
diff --git a/examples/pong3d_title.tga b/examples/pong3d_title.tga
deleted file mode 100644
index d0d8e36d74011c25b908647632b4997dc0cf6456..0000000000000000000000000000000000000000
GIT binary patch
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