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
ff6a8891
Commit
ff6a8891
authored
Feb 4, 2018
by
Camilla Löwy
Browse files
Options
Downloads
Patches
Plain Diff
Make remaining tests set viewport in render loop
parent
c29e4455
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
tests/clipboard.c
+0
-6
0 additions, 6 deletions
tests/clipboard.c
tests/events.c
+0
-2
0 additions, 2 deletions
tests/events.c
tests/iconify.c
+0
-2
0 additions, 2 deletions
tests/iconify.c
tests/tearing.c
+4
-6
4 additions, 6 deletions
tests/tearing.c
tests/title.c
+0
-7
0 additions, 7 deletions
tests/title.c
with
4 additions
and
23 deletions
tests/clipboard.c
+
0
−
6
View file @
ff6a8891
...
...
@@ -86,11 +86,6 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
}
}
static
void
framebuffer_size_callback
(
GLFWwindow
*
window
,
int
width
,
int
height
)
{
glViewport
(
0
,
0
,
width
,
height
);
}
int
main
(
int
argc
,
char
**
argv
)
{
int
ch
;
...
...
@@ -132,7 +127,6 @@ int main(int argc, char** argv)
glfwSwapInterval
(
1
);
glfwSetKeyCallback
(
window
,
key_callback
);
glfwSetFramebufferSizeCallback
(
window
,
framebuffer_size_callback
);
glClearColor
(
0
.
5
f
,
0
.
5
f
,
0
.
5
f
,
0
);
...
...
This diff is collapsed.
Click to expand it.
tests/events.c
+
0
−
2
View file @
ff6a8891
...
...
@@ -289,8 +289,6 @@ static void framebuffer_size_callback(GLFWwindow* window, int width, int height)
Slot
*
slot
=
glfwGetWindowUserPointer
(
window
);
printf
(
"%08x to %i at %0.3f: Framebuffer size: %i %i
\n
"
,
counter
++
,
slot
->
number
,
glfwGetTime
(),
width
,
height
);
glViewport
(
0
,
0
,
width
,
height
);
}
static
void
window_content_scale_callback
(
GLFWwindow
*
window
,
float
xscale
,
float
yscale
)
...
...
This diff is collapsed.
Click to expand it.
tests/iconify.c
+
0
−
2
View file @
ff6a8891
...
...
@@ -127,8 +127,6 @@ static void window_size_callback(GLFWwindow* window, int width, int height)
static
void
framebuffer_size_callback
(
GLFWwindow
*
window
,
int
width
,
int
height
)
{
printf
(
"%0.2f Framebuffer resized to %ix%i
\n
"
,
glfwGetTime
(),
width
,
height
);
glViewport
(
0
,
0
,
width
,
height
);
}
static
void
window_focus_callback
(
GLFWwindow
*
window
,
int
focused
)
...
...
This diff is collapsed.
Click to expand it.
tests/tearing.c
+
4
−
6
View file @
ff6a8891
...
...
@@ -92,11 +92,6 @@ static void error_callback(int error, const char* description)
fprintf
(
stderr
,
"Error: %s
\n
"
,
description
);
}
static
void
framebuffer_size_callback
(
GLFWwindow
*
window
,
int
width
,
int
height
)
{
glViewport
(
0
,
0
,
width
,
height
);
}
static
void
key_callback
(
GLFWwindow
*
window
,
int
key
,
int
scancode
,
int
action
,
int
mods
)
{
if
(
action
!=
GLFW_PRESS
)
...
...
@@ -188,7 +183,6 @@ int main(int argc, char** argv)
swap_tear
=
(
glfwExtensionSupported
(
"WGL_EXT_swap_control_tear"
)
||
glfwExtensionSupported
(
"GLX_EXT_swap_control_tear"
));
glfwSetFramebufferSizeCallback
(
window
,
framebuffer_size_callback
);
glfwSetKeyCallback
(
window
,
key_callback
);
glGenBuffers
(
1
,
&
vertex_buffer
);
...
...
@@ -217,9 +211,13 @@ int main(int argc, char** argv)
while
(
!
glfwWindowShouldClose
(
window
))
{
int
width
,
height
;
mat4x4
m
,
p
,
mvp
;
float
position
=
cosf
((
float
)
glfwGetTime
()
*
4
.
f
)
*
0
.
75
f
;
glfwGetFramebufferSize
(
window
,
&
width
,
&
height
);
glViewport
(
0
,
0
,
width
,
height
);
glClear
(
GL_COLOR_BUFFER_BIT
);
mat4x4_ortho
(
p
,
-
1
.
f
,
1
.
f
,
-
1
.
f
,
1
.
f
,
0
.
f
,
1
.
f
);
...
...
This diff is collapsed.
Click to expand it.
tests/title.c
+
0
−
7
View file @
ff6a8891
...
...
@@ -38,11 +38,6 @@ static void error_callback(int error, const char* description)
fprintf
(
stderr
,
"Error: %s
\n
"
,
description
);
}
static
void
framebuffer_size_callback
(
GLFWwindow
*
window
,
int
width
,
int
height
)
{
glViewport
(
0
,
0
,
width
,
height
);
}
int
main
(
void
)
{
GLFWwindow
*
window
;
...
...
@@ -63,8 +58,6 @@ int main(void)
gladLoadGLLoader
((
GLADloadproc
)
glfwGetProcAddress
);
glfwSwapInterval
(
1
);
glfwSetFramebufferSizeCallback
(
window
,
framebuffer_size_callback
);
while
(
!
glfwWindowShouldClose
(
window
))
{
glClear
(
GL_COLOR_BUFFER_BIT
);
...
...
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