mirror of
https://github.com/glfw/glfw.git
synced 2026-11-18 12:54:54 +00:00
Renamed glfwGetWindowParam to glfwGetWindowAttrib.
Parameters are something specified at creation time and are often immutable, while many of the values returned by glfwGetWindowParam reflected current state not controlled by any parameter or hint.
This commit is contained in:
+16
-16
@@ -23,8 +23,8 @@
|
||||
//
|
||||
//========================================================================
|
||||
//
|
||||
// This test creates a windowed mode window with all parameters set to
|
||||
// default values and then reports the actual parameters of the created
|
||||
// This test creates a windowed mode window with all window hints set to
|
||||
// default values and then reports the actual attributes of the created
|
||||
// window and context
|
||||
//
|
||||
//========================================================================
|
||||
@@ -37,18 +37,18 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int param;
|
||||
int attrib;
|
||||
const char* ext;
|
||||
const char* name;
|
||||
} ParamGL;
|
||||
} AttribGL;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int param;
|
||||
int attrib;
|
||||
const char* name;
|
||||
} ParamGLFW;
|
||||
} AttribGLFW;
|
||||
|
||||
static ParamGL gl_params[] =
|
||||
static AttribGL gl_attribs[] =
|
||||
{
|
||||
{ GL_RED_BITS, NULL, "red bits" },
|
||||
{ GL_GREEN_BITS, NULL, "green bits" },
|
||||
@@ -61,7 +61,7 @@ static ParamGL gl_params[] =
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
static ParamGLFW glfw_params[] =
|
||||
static AttribGLFW glfw_attribs[] =
|
||||
{
|
||||
{ GLFW_CONTEXT_VERSION_MAJOR, "Context version major" },
|
||||
{ GLFW_CONTEXT_VERSION_MINOR, "Context version minor" },
|
||||
@@ -100,26 +100,26 @@ int main(void)
|
||||
|
||||
printf("window size: %ix%i\n", width, height);
|
||||
|
||||
for (i = 0; glfw_params[i].name; i++)
|
||||
for (i = 0; glfw_attribs[i].name; i++)
|
||||
{
|
||||
printf("%s: %i\n",
|
||||
glfw_params[i].name,
|
||||
glfwGetWindowParam(window, glfw_params[i].param));
|
||||
glfw_attribs[i].name,
|
||||
glfwGetWindowAttrib(window, glfw_attribs[i].attrib));
|
||||
}
|
||||
|
||||
for (i = 0; gl_params[i].name; i++)
|
||||
for (i = 0; gl_attribs[i].name; i++)
|
||||
{
|
||||
GLint value = 0;
|
||||
|
||||
if (gl_params[i].ext)
|
||||
if (gl_attribs[i].ext)
|
||||
{
|
||||
if (!glfwExtensionSupported(gl_params[i].ext))
|
||||
if (!glfwExtensionSupported(gl_attribs[i].ext))
|
||||
continue;
|
||||
}
|
||||
|
||||
glGetIntegerv(gl_params[i].param, &value);
|
||||
glGetIntegerv(gl_attribs[i].attrib, &value);
|
||||
|
||||
printf("%s: %i\n", gl_params[i].name, value);
|
||||
printf("%s: %i\n", gl_attribs[i].name, value);
|
||||
}
|
||||
|
||||
glfwDestroyWindow(window);
|
||||
|
||||
Reference in New Issue
Block a user