Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
glfw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pirvi-public
glfw
Commits
819a2205
Commit
819a2205
authored
7 years ago
by
Camilla Löwy
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup
parent
5d8b04a7
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/init.c
+24
-32
24 additions, 32 deletions
src/init.c
with
24 additions
and
32 deletions
src/init.c
+
24
−
32
View file @
819a2205
...
...
@@ -57,37 +57,6 @@ static _GLFWinitconfig _glfwInitHints =
}
};
// Returns a generic string representation of the specified error
//
static
const
char
*
getErrorString
(
int
code
)
{
switch
(
code
)
{
case
GLFW_NOT_INITIALIZED
:
return
"The GLFW library is not initialized"
;
case
GLFW_NO_CURRENT_CONTEXT
:
return
"There is no current context"
;
case
GLFW_INVALID_ENUM
:
return
"Invalid argument for enum parameter"
;
case
GLFW_INVALID_VALUE
:
return
"Invalid value for parameter"
;
case
GLFW_OUT_OF_MEMORY
:
return
"Out of memory"
;
case
GLFW_API_UNAVAILABLE
:
return
"The requested API is unavailable"
;
case
GLFW_VERSION_UNAVAILABLE
:
return
"The requested API version is unavailable"
;
case
GLFW_PLATFORM_ERROR
:
return
"An undocumented platform-specific error occurred"
;
case
GLFW_FORMAT_UNAVAILABLE
:
return
"The requested format is unavailable"
;
case
GLFW_NO_WINDOW_CONTEXT
:
return
"The specified window has no context"
;
default:
return
"ERROR: UNKNOWN GLFW ERROR"
;
}
}
// Terminate the library
//
static
void
terminate
(
void
)
...
...
@@ -173,7 +142,30 @@ void _glfwInputError(int code, const char* format, ...)
description
[
sizeof
(
description
)
-
1
]
=
'\0'
;
}
else
strcpy
(
description
,
getErrorString
(
code
));
{
if
(
code
==
GLFW_NOT_INITIALIZED
)
strcpy
(
description
,
"The GLFW library is not initialized"
);
else
if
(
code
==
GLFW_NO_CURRENT_CONTEXT
)
strcpy
(
description
,
"There is no current context"
);
else
if
(
code
==
GLFW_INVALID_ENUM
)
strcpy
(
description
,
"Invalid argument for enum parameter"
);
else
if
(
code
==
GLFW_INVALID_VALUE
)
strcpy
(
description
,
"Invalid value for parameter"
);
else
if
(
code
==
GLFW_OUT_OF_MEMORY
)
strcpy
(
description
,
"Out of memory"
);
else
if
(
code
==
GLFW_API_UNAVAILABLE
)
strcpy
(
description
,
"The requested API is unavailable"
);
else
if
(
code
==
GLFW_VERSION_UNAVAILABLE
)
strcpy
(
description
,
"The requested API version is unavailable"
);
else
if
(
code
==
GLFW_PLATFORM_ERROR
)
strcpy
(
description
,
"A platform-specific error occurred"
);
else
if
(
code
==
GLFW_FORMAT_UNAVAILABLE
)
strcpy
(
description
,
"The requested format is unavailable"
);
else
if
(
code
==
GLFW_NO_WINDOW_CONTEXT
)
strcpy
(
description
,
"The specified window has no context"
);
else
strcpy
(
description
,
"ERROR: UNKNOWN GLFW ERROR"
);
}
if
(
_glfw
.
initialized
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment