mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 12:02:00 +00:00
Removed GLFWthreadmodel and glfwInitWithModels.
This commit is contained in:
parent
609c008a19
commit
b997db3a8b
@ -569,7 +569,7 @@ int main( void )
|
|||||||
GLFWwindow window;
|
GLFWwindow window;
|
||||||
|
|
||||||
/* Init GLFW */
|
/* Init GLFW */
|
||||||
if( !glfwInit() )
|
if( !glfwInit(NULL) )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Failed to initialize GLFW\n" );
|
fprintf( stderr, "Failed to initialize GLFW\n" );
|
||||||
exit( EXIT_FAILURE );
|
exit( EXIT_FAILURE );
|
||||||
|
@ -323,7 +323,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
GLFWwindow window;
|
GLFWwindow window;
|
||||||
|
|
||||||
if( !glfwInit() )
|
if( !glfwInit(NULL) )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Failed to initialize GLFW\n" );
|
fprintf( stderr, "Failed to initialize GLFW\n" );
|
||||||
exit( EXIT_FAILURE );
|
exit( EXIT_FAILURE );
|
||||||
|
@ -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");
|
fprintf(stderr, "ERROR: Unable to initialize GLFW\n");
|
||||||
usage();
|
usage();
|
||||||
|
@ -442,7 +442,7 @@ int main(void)
|
|||||||
GLFWwindow window;
|
GLFWwindow window;
|
||||||
|
|
||||||
// Initialise GLFW
|
// Initialise GLFW
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize GLFW\n");
|
fprintf(stderr, "Failed to initialize GLFW\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -15,7 +15,7 @@ int main(void)
|
|||||||
GLFWwindow window;
|
GLFWwindow window;
|
||||||
|
|
||||||
// Initialise GLFW
|
// Initialise GLFW
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize GLFW\n");
|
fprintf(stderr, "Failed to initialize GLFW\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -379,7 +379,7 @@ int main(int argc, char* argv[])
|
|||||||
GLFWwindow window;
|
GLFWwindow window;
|
||||||
double t, dt_total, t_old;
|
double t, dt_total, t_old;
|
||||||
|
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "GLFW initialization failed\n");
|
fprintf(stderr, "GLFW initialization failed\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -506,20 +506,13 @@ typedef struct
|
|||||||
GLFWfreefun free;
|
GLFWfreefun free;
|
||||||
} GLFWallocator;
|
} GLFWallocator;
|
||||||
|
|
||||||
/* Custom threading model interface */
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int dummy;
|
|
||||||
} GLFWthreadmodel;
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* Prototypes
|
* Prototypes
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
/* Initialization, termination and version querying */
|
/* Initialization, termination and version querying */
|
||||||
GLFWAPI int glfwInit(void);
|
GLFWAPI int glfwInit(GLFWallocator* allocator);
|
||||||
GLFWAPI int glfwInitWithModels(GLFWthreadmodel* threading, GLFWallocator* allocator);
|
|
||||||
GLFWAPI void glfwTerminate(void);
|
GLFWAPI void glfwTerminate(void);
|
||||||
GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);
|
GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);
|
||||||
GLFWAPI const char* glfwGetVersionString(void);
|
GLFWAPI const char* glfwGetVersionString(void);
|
||||||
|
@ -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>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>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>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>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_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>
|
<li>Added <code>GLFW_OPENGL_ROBUSTNESS</code> window hint and associated strategy tokens for <code>GL_ARB_robustness</code> support</li>
|
||||||
|
15
src/init.c
15
src/init.c
@ -67,26 +67,13 @@ void _glfwFree(void* ptr)
|
|||||||
// Initialize various GLFW state
|
// Initialize various GLFW state
|
||||||
//========================================================================
|
//========================================================================
|
||||||
|
|
||||||
GLFWAPI int glfwInit(void)
|
GLFWAPI int glfwInit(GLFWallocator* allocator)
|
||||||
{
|
|
||||||
return glfwInitWithModels(NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//========================================================================
|
|
||||||
// Initialize various GLFW state using custom model interfaces
|
|
||||||
//========================================================================
|
|
||||||
|
|
||||||
GLFWAPI int glfwInitWithModels(GLFWthreadmodel* threading, GLFWallocator* allocator)
|
|
||||||
{
|
{
|
||||||
if (_glfwInitialized)
|
if (_glfwInitialized)
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
|
|
||||||
memset(&_glfwLibrary, 0, sizeof(_glfwLibrary));
|
memset(&_glfwLibrary, 0, sizeof(_glfwLibrary));
|
||||||
|
|
||||||
if (threading)
|
|
||||||
_glfwLibrary.threading = *threading;
|
|
||||||
|
|
||||||
if (allocator)
|
if (allocator)
|
||||||
{
|
{
|
||||||
// Verify that the specified model is complete
|
// Verify that the specified model is complete
|
||||||
|
@ -241,7 +241,6 @@ struct _GLFWlibrary
|
|||||||
GLFWkeyfun keyCallback;
|
GLFWkeyfun keyCallback;
|
||||||
GLFWcharfun charCallback;
|
GLFWcharfun charCallback;
|
||||||
|
|
||||||
GLFWthreadmodel threading;
|
|
||||||
GLFWallocator allocator;
|
GLFWallocator allocator;
|
||||||
|
|
||||||
GLFWgammaramp currentRamp;
|
GLFWgammaramp currentRamp;
|
||||||
|
@ -59,7 +59,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
GLFWwindow window;
|
GLFWwindow window;
|
||||||
|
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -69,7 +69,7 @@ int main(void)
|
|||||||
int i, width, height;
|
int i, width, height;
|
||||||
GLFWwindow window;
|
GLFWwindow window;
|
||||||
|
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -59,7 +59,7 @@ int main(void)
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize GLFW\n");
|
fprintf(stderr, "Failed to initialize GLFW\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -330,7 +330,7 @@ int main(void)
|
|||||||
|
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
|
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -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()));
|
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -75,7 +75,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
GLFWwindow window;
|
GLFWwindow window;
|
||||||
|
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -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()));
|
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -183,7 +183,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
glfwSetErrorCallback(error_callback);
|
glfwSetErrorCallback(error_callback);
|
||||||
|
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -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()));
|
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -94,7 +94,7 @@ int main(void)
|
|||||||
double update;
|
double update;
|
||||||
|
|
||||||
/* Initialise GLFW */
|
/* Initialise GLFW */
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -21,7 +21,7 @@ int main(void)
|
|||||||
GLFWvidmode dtmode, modes[400];
|
GLFWvidmode dtmode, modes[400];
|
||||||
int modecount, i;
|
int modecount, i;
|
||||||
|
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -111,7 +111,7 @@ static GLboolean open_window(void)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -84,7 +84,7 @@ static GLboolean open_window(int width, int height, int mode)
|
|||||||
{
|
{
|
||||||
double base;
|
double base;
|
||||||
|
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
@ -117,7 +117,7 @@ int main(int argc, char** argv)
|
|||||||
GLuint texture;
|
GLuint texture;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -44,7 +44,7 @@ int main(void)
|
|||||||
float position;
|
float position;
|
||||||
GLFWwindow window;
|
GLFWwindow window;
|
||||||
|
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
@ -46,7 +46,7 @@ int main(void)
|
|||||||
GLboolean running = GL_TRUE;
|
GLboolean running = GL_TRUE;
|
||||||
GLFWwindow windows[4];
|
GLFWwindow windows[4];
|
||||||
|
|
||||||
if (!glfwInit())
|
if (!glfwInit(NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to initialize GLFW: %s\n",
|
fprintf(stderr, "Failed to initialize GLFW: %s\n",
|
||||||
glfwErrorString(glfwGetError()));
|
glfwErrorString(glfwGetError()));
|
||||||
|
Loading…
Reference in New Issue
Block a user