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
9017eaee
Commit
9017eaee
authored
8 years ago
by
Camilla Löwy
Browse files
Options
Downloads
Patches
Plain Diff
Add debug extension support to sharing test
parent
38aae024
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/CMakeLists.txt
+1
-1
1 addition, 1 deletion
tests/CMakeLists.txt
tests/sharing.c
+29
-0
29 additions, 0 deletions
tests/sharing.c
with
30 additions
and
1 deletion
tests/CMakeLists.txt
+
1
−
1
View file @
9017eaee
...
...
@@ -31,7 +31,7 @@ add_executable(cursor cursor.c ${GLAD})
add_executable
(
empty WIN32 MACOSX_BUNDLE empty.c
${
TINYCTHREAD
}
${
GLAD
}
)
add_executable
(
icon WIN32 MACOSX_BUNDLE icon.c
${
GLAD
}
)
add_executable
(
sharing WIN32 MACOSX_BUNDLE sharing.c
${
GLAD
}
)
add_executable
(
sharing WIN32 MACOSX_BUNDLE sharing.c
${
GETOPT
}
${
GLAD
}
)
add_executable
(
tearing WIN32 MACOSX_BUNDLE tearing.c
${
GETOPT
}
${
GLAD
}
)
add_executable
(
threads WIN32 MACOSX_BUNDLE threads.c
${
TINYCTHREAD
}
${
GLAD
}
)
add_executable
(
timeout WIN32 MACOSX_BUNDLE timeout.c
${
GLAD
}
)
...
...
This diff is collapsed.
Click to expand it.
tests/sharing.c
+
29
−
0
View file @
9017eaee
...
...
@@ -34,6 +34,7 @@
#include
<stdio.h>
#include
<stdlib.h>
#include
"getopt.h"
#include
"linmath.h"
static
const
char
*
vertex_shader_text
=
...
...
@@ -68,6 +69,17 @@ static void error_callback(int error, const char* description)
fprintf
(
stderr
,
"Error: %s
\n
"
,
description
);
}
void
APIENTRY
debug_callback
(
GLenum
source
,
GLenum
type
,
GLuint
id
,
GLenum
severity
,
GLsizei
length
,
const
GLchar
*
message
,
const
void
*
user
)
{
fprintf
(
stderr
,
"Error: %s
\n
"
,
message
);
}
static
void
key_callback
(
GLFWwindow
*
window
,
int
key
,
int
scancode
,
int
action
,
int
mods
)
{
if
(
action
==
GLFW_PRESS
&&
key
==
GLFW_KEY_ESCAPE
)
...
...
@@ -76,6 +88,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
int
main
(
int
argc
,
char
**
argv
)
{
int
ch
;
GLFWwindow
*
windows
[
2
];
GLuint
texture
,
program
,
vertex_buffer
;
GLint
mvp_location
,
vpos_location
,
color_location
,
texture_location
;
...
...
@@ -87,6 +100,16 @@ int main(int argc, char** argv)
if
(
!
glfwInit
())
exit
(
EXIT_FAILURE
);
while
((
ch
=
getopt
(
argc
,
argv
,
"d"
))
!=
-
1
)
{
switch
(
ch
)
{
case
'd'
:
glfwWindowHint
(
GLFW_OPENGL_DEBUG_CONTEXT
,
GLFW_TRUE
);
break
;
}
}
glfwWindowHint
(
GLFW_CONTEXT_VERSION_MAJOR
,
2
);
glfwWindowHint
(
GLFW_CONTEXT_VERSION_MINOR
,
0
);
...
...
@@ -109,6 +132,12 @@ int main(int argc, char** argv)
// pointers should be re-usable between them
gladLoadGLLoader
((
GLADloadproc
)
glfwGetProcAddress
);
if
(
GLAD_GL_ARB_debug_output
)
{
glDebugMessageCallbackARB
(
debug_callback
,
NULL
);
glDebugMessageControlARB
(
GL_DONT_CARE
,
GL_DONT_CARE
,
GL_DONT_CARE
,
0
,
NULL
,
GL_TRUE
);
}
// Create the OpenGL objects inside the first context, created above
// All objects will be shared with the second context, created below
{
...
...
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