Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
8e56849e
Commit
8e56849e
authored
Feb 20, 2011
by
Sam Lantinga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed testgles on iOS (bug 1136)
parent
f0c19729
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
+14
-8
SDL_uikitopengles.m
src/video/uikit/SDL_uikitopengles.m
+1
-1
common.c
test/common.c
+5
-4
testgles.c
test/testgles.c
+8
-3
No files found.
src/video/uikit/SDL_uikitopengles.m
View file @
8e56849e
...
...
@@ -40,7 +40,7 @@ UIKit_GL_GetProcAddress(_THIS, const char *proc)
-
Looking
for
the
path
to
the
OpenGL
Library
seems
not
to
work
in
the
iPhone
Simulator
.
-
We
don
'
t
know
that
the
path
won
'
t
change
in
the
future
.
*/
return
SDL
_
LoadFunction
(
RTLD
_
DEFAULT
,
proc
)
;
return
dlsym
(
RTLD
_
DEFAULT
,
proc
)
;
}
/*
...
...
test/common.c
View file @
8e56849e
...
...
@@ -53,8 +53,6 @@ CommonCreateState(char **argv, Uint32 flags)
state
->
gl_multisamplesamples
=
0
;
state
->
gl_retained_backing
=
1
;
state
->
gl_accelerated
=
-
1
;
state
->
gl_major_version
=
2
;
state
->
gl_minor_version
=
1
;
return
state
;
}
...
...
@@ -590,8 +588,10 @@ CommonInit(CommonState * state)
state
->
gl_accelerated
);
}
SDL_GL_SetAttribute
(
SDL_GL_RETAINED_BACKING
,
state
->
gl_retained_backing
);
SDL_GL_SetAttribute
(
SDL_GL_CONTEXT_MAJOR_VERSION
,
state
->
gl_major_version
);
SDL_GL_SetAttribute
(
SDL_GL_CONTEXT_MINOR_VERSION
,
state
->
gl_minor_version
);
if
(
state
->
gl_major_version
)
{
SDL_GL_SetAttribute
(
SDL_GL_CONTEXT_MAJOR_VERSION
,
state
->
gl_major_version
);
SDL_GL_SetAttribute
(
SDL_GL_CONTEXT_MINOR_VERSION
,
state
->
gl_minor_version
);
}
if
(
state
->
verbose
&
VERBOSE_MODES
)
{
SDL_DisplayMode
mode
;
...
...
@@ -712,6 +712,7 @@ CommonInit(CommonState * state)
SDL_GetError
());
return
SDL_FALSE
;
}
SDL_GetWindowSize
(
state
->
windows
[
i
],
&
state
->
window_w
,
&
state
->
window_h
);
if
(
SDL_SetWindowDisplayMode
(
state
->
windows
[
i
],
&
fullscreen_mode
)
<
0
)
{
fprintf
(
stderr
,
"Can't set up fullscreen display mode: %s
\n
"
,
...
...
test/testgles.c
View file @
8e56849e
...
...
@@ -177,7 +177,7 @@ main(int argc, char *argv[])
SDL_GL_SetSwapInterval
(
0
);
}
SDL_GetCurrentDisplayMode
(
&
mode
);
SDL_GetCurrentDisplayMode
(
0
,
&
mode
);
printf
(
"Screen bpp: %d
\n
"
,
SDL_BITSPERPIXEL
(
mode
.
format
));
printf
(
"
\n
"
);
printf
(
"Vendor : %s
\n
"
,
glGetString
(
GL_VENDOR
));
...
...
@@ -243,6 +243,8 @@ main(int argc, char *argv[])
/* Set rendering settings for each context */
for
(
i
=
0
;
i
<
state
->
num_windows
;
++
i
)
{
float
aspectAdjust
;
status
=
SDL_GL_MakeCurrent
(
state
->
windows
[
i
],
context
[
i
]);
if
(
status
)
{
printf
(
"SDL_GL_MakeCurrent(): %s
\n
"
,
SDL_GetError
());
...
...
@@ -251,10 +253,11 @@ main(int argc, char *argv[])
continue
;
}
aspectAdjust
=
(
4
.
0
f
/
3
.
0
f
)
/
((
float
)
state
->
window_w
/
state
->
window_h
);
glViewport
(
0
,
0
,
state
->
window_w
,
state
->
window_h
);
glMatrixMode
(
GL_PROJECTION
);
glLoadIdentity
();
glOrthof
(
-
2
.
0
,
2
.
0
,
-
2
.
0
,
2
.
0
,
-
20
.
0
,
20
.
0
);
glOrthof
(
-
2
.
0
,
2
.
0
,
-
2
.
0
*
aspectAdjust
,
2
.
0
*
aspectAdjust
,
-
20
.
0
,
20
.
0
);
glMatrixMode
(
GL_MODELVIEW
);
glLoadIdentity
();
glEnable
(
GL_DEPTH_TEST
);
...
...
@@ -275,7 +278,7 @@ main(int argc, char *argv[])
switch
(
event
.
window
.
event
)
{
case
SDL_WINDOWEVENT_RESIZED
:
for
(
i
=
0
;
i
<
state
->
num_windows
;
++
i
)
{
if
(
event
.
window
.
windowID
==
state
->
windows
[
i
]
)
{
if
(
event
.
window
.
windowID
==
SDL_GetWindowID
(
state
->
windows
[
i
])
)
{
status
=
SDL_GL_MakeCurrent
(
state
->
windows
[
i
],
context
[
i
]);
if
(
status
)
{
printf
(
"SDL_GL_MakeCurrent(): %s
\n
"
,
SDL_GetError
());
...
...
@@ -327,3 +330,5 @@ main(int argc, char *argv[])
}
#endif
/* HAVE_OPENGLES */
/* vi: set ts=4 sw=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment