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
578cd935
Commit
578cd935
authored
Aug 26, 2011
by
Tim Angus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Support OpenGL ES 2 on Android
parent
1808d892
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
SDLActivity.java
android-project/src/org/libsdl/app/SDLActivity.java
+10
-2
No files found.
android-project/src/org/libsdl/app/SDLActivity.java
View file @
578cd935
package
org
.
libsdl
.
app
;
package
org
.
libsdl
.
app
;
import
javax.microedition.khronos.egl.EGL10
;
import
javax.microedition.khronos.egl.EGLConfig
;
import
javax.microedition.khronos.egl.EGLConfig
;
import
javax.microedition.khronos.egl.EGLContext
;
import
javax.microedition.khronos.opengles.GL10
;
import
javax.microedition.khronos.opengles.GL10
;
import
javax.microedition.khronos.egl.*
;
import
javax.microedition.khronos.egl.*
;
...
@@ -388,7 +390,13 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
...
@@ -388,7 +390,13 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
}
}
EGLConfig
config
=
configs
[
0
];
EGLConfig
config
=
configs
[
0
];
EGLContext
ctx
=
egl
.
eglCreateContext
(
dpy
,
config
,
EGL10
.
EGL_NO_CONTEXT
,
null
);
int
EGL_CONTEXT_CLIENT_VERSION
=
0x3098
;
int
contextAttrs
[]
=
new
int
[]
{
EGL_CONTEXT_CLIENT_VERSION
,
majorVersion
,
EGL10
.
EGL_NONE
};
EGLContext
ctx
=
egl
.
eglCreateContext
(
dpy
,
config
,
EGL10
.
EGL_NO_CONTEXT
,
contextAttrs
);
if
(
ctx
==
EGL10
.
EGL_NO_CONTEXT
)
{
if
(
ctx
==
EGL10
.
EGL_NO_CONTEXT
)
{
Log
.
e
(
"SDL"
,
"Couldn't create context"
);
Log
.
e
(
"SDL"
,
"Couldn't create context"
);
return
false
;
return
false
;
...
@@ -424,7 +432,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
...
@@ -424,7 +432,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
try
{
try
{
EGL10
egl
=
(
EGL10
)
EGLContext
.
getEGL
();
EGL10
egl
=
(
EGL10
)
EGLContext
.
getEGL
();
egl
.
eglWaitNative
(
EGL10
.
EGL_
NATIVE_RENDERABL
E
,
null
);
egl
.
eglWaitNative
(
EGL10
.
EGL_
CORE_NATIVE_ENGIN
E
,
null
);
// drawing here
// drawing here
...
...
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