Removed GLFWthreadmodel and glfwInitWithModels.

This commit is contained in:
Camilla Berglund 2012-02-04 01:37:47 +01:00
parent 609c008a19
commit b997db3a8b
26 changed files with 25 additions and 46 deletions

View File

@ -569,7 +569,7 @@ int main( void )
GLFWwindow window;
/* Init GLFW */
if( !glfwInit() )
if( !glfwInit(NULL) )
{
fprintf( stderr, "Failed to initialize GLFW\n" );
exit( EXIT_FAILURE );

View File

@ -323,7 +323,7 @@ int main(int argc, char *argv[])
{
GLFWwindow window;
if( !glfwInit() )
if( !glfwInit(NULL) )
{
fprintf( stderr, "Failed to initialize GLFW\n" );
exit( EXIT_FAILURE );

View File

@ -573,7 +573,7 @@ int main(int argc, char** argv)
}
}
if (GL_TRUE != glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "ERROR: Unable to initialize GLFW\n");
usage();

View File

@ -442,7 +442,7 @@ int main(void)
GLFWwindow window;
// Initialise GLFW
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW\n");
exit(EXIT_FAILURE);

View File

@ -15,7 +15,7 @@ int main(void)
GLFWwindow window;
// Initialise GLFW
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW\n");
exit(EXIT_FAILURE);

View File

@ -379,7 +379,7 @@ int main(int argc, char* argv[])
GLFWwindow window;
double t, dt_total, t_old;
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "GLFW initialization failed\n");
exit(EXIT_FAILURE);

View File

@ -506,20 +506,13 @@ typedef struct
GLFWfreefun free;
} GLFWallocator;
/* Custom threading model interface */
typedef struct
{
int dummy;
} GLFWthreadmodel;
/*************************************************************************
* Prototypes
*************************************************************************/
/* Initialization, termination and version querying */
GLFWAPI int glfwInit(void);
GLFWAPI int glfwInitWithModels(GLFWthreadmodel* threading, GLFWallocator* allocator);
GLFWAPI int glfwInit(GLFWallocator* allocator);
GLFWAPI void glfwTerminate(void);
GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);
GLFWAPI const char* glfwGetVersionString(void);

View File

@ -272,7 +272,7 @@ version of GLFW.</p>
<li>Added <code>glfwSetWindowFocusCallback</code> function and <code>GLFWwindowfocusfun</code> type for receiving window focus events</li>
<li>Added <code>glfwSetWindowIconifyCallback</code> function and <code>GLFWwindowiconifyfun</code> type for receiving window iconification events</li>
<li>Added <code>glfwGetCurrentContext</code> function for retrieving the window whose OpenGL context is current</li>
<li>Added <code>glfwInitWithModels</code> function and <code>GLFWallocator</code> and <code>GLFWthreadmodel</code> types for pluggable memory allocation and threading models</li>
<li>Added <code>GLFWallocator</code> type and <code>glfwInit</code> parameter for pluggable memory allocator</li>
<li>Added <code>glfwCopyContext</code> function for copying OpenGL state categories between contexts</li>
<li>Added <code>GLFW_OPENGL_ES2_PROFILE</code> profile for creating OpenGL ES 2.0 contexts using the <code>GLX_EXT_create_context_es2_profile</code> and <code>WGL_EXT_create_context_es2_profile</code> extensions</li>
<li>Added <code>GLFW_OPENGL_ROBUSTNESS</code> window hint and associated strategy tokens for <code>GL_ARB_robustness</code> support</li>

View File

@ -67,26 +67,13 @@ void _glfwFree(void* ptr)
// Initialize various GLFW state
//========================================================================
GLFWAPI int glfwInit(void)
{
return glfwInitWithModels(NULL, NULL);
}
//========================================================================
// Initialize various GLFW state using custom model interfaces
//========================================================================
GLFWAPI int glfwInitWithModels(GLFWthreadmodel* threading, GLFWallocator* allocator)
GLFWAPI int glfwInit(GLFWallocator* allocator)
{
if (_glfwInitialized)
return GL_TRUE;
memset(&_glfwLibrary, 0, sizeof(_glfwLibrary));
if (threading)
_glfwLibrary.threading = *threading;
if (allocator)
{
// Verify that the specified model is complete

View File

@ -241,7 +241,6 @@ struct _GLFWlibrary
GLFWkeyfun keyCallback;
GLFWcharfun charCallback;
GLFWthreadmodel threading;
GLFWallocator allocator;
GLFWgammaramp currentRamp;

View File

@ -59,7 +59,7 @@ int main(void)
{
GLFWwindow window;
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
exit(EXIT_FAILURE);

View File

@ -69,7 +69,7 @@ int main(void)
int i, width, height;
GLFWwindow window;
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
exit(EXIT_FAILURE);

View File

@ -59,7 +59,7 @@ int main(void)
exit(EXIT_FAILURE);
}
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW\n");
exit(EXIT_FAILURE);

View File

@ -330,7 +330,7 @@ int main(void)
setlocale(LC_ALL, "");
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
exit(EXIT_FAILURE);

View File

@ -81,7 +81,7 @@ int main(int argc, char** argv)
}
}
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
exit(EXIT_FAILURE);

View File

@ -75,7 +75,7 @@ int main(void)
{
GLFWwindow window;
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
exit(EXIT_FAILURE);

View File

@ -96,7 +96,7 @@ int main(int argc, char** argv)
}
}
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
exit(EXIT_FAILURE);

View File

@ -183,7 +183,7 @@ int main(int argc, char** argv)
glfwSetErrorCallback(error_callback);
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
exit(EXIT_FAILURE);

View File

@ -90,7 +90,7 @@ int main(int argc, char** argv)
}
}
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
exit(EXIT_FAILURE);

View File

@ -94,7 +94,7 @@ int main(void)
double update;
/* Initialise GLFW */
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
exit(EXIT_FAILURE);

View File

@ -21,7 +21,7 @@ int main(void)
GLFWvidmode dtmode, modes[400];
int modecount, i;
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
exit(EXIT_FAILURE);

View File

@ -111,7 +111,7 @@ static GLboolean open_window(void)
int main(void)
{
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
exit(EXIT_FAILURE);

View File

@ -84,7 +84,7 @@ static GLboolean open_window(int width, int height, int mode)
{
double base;
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
return GL_FALSE;

View File

@ -117,7 +117,7 @@ int main(int argc, char** argv)
GLuint texture;
int x, y;
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
exit(EXIT_FAILURE);

View File

@ -44,7 +44,7 @@ int main(void)
float position;
GLFWwindow window;
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
exit(EXIT_FAILURE);

View File

@ -46,7 +46,7 @@ int main(void)
GLboolean running = GL_TRUE;
GLFWwindow windows[4];
if (!glfwInit())
if (!glfwInit(NULL))
{
fprintf(stderr, "Failed to initialize GLFW: %s\n",
glfwErrorString(glfwGetError()));