| Andriod SDL_2.0/OPENGL ES 1.1/NDK Base for Eclipse? |
| Andriod SDL_2.0/OPENGL ES 1.1/NDK Base for Eclipse? |
|
Sik
|
OpenGL ES is *not* OpenGL, it's just a subset made especifically for
very low-end devices (such as mobile). GL_QUADS doesn't exist in OpenGL ES, for instance (you need to use two triangles). This is your issue. May want to look up more about OpenGL ES first because otherwise you won't get anywhere. 2013/4/27, Timodor:
SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
|
||||||||||||||
| Andriod SDL_2.0/OPENGL ES 1.1/NDK Base for Eclipse? |
|
Jonny D
|
There is an Android project in the SDL 2 source tree. Here's some (unfinished) info about it:http://www.dinomage.com/2013/01/howto-sdl-on-android/
You should refer to the wiki for porting tips from SDL1.2 to SDL2. If you have any other problems, let us know. http://wiki.libsdl.org/moin.fcg/MigrationGuide Jonny D On Sat, Apr 27, 2013 at 7:47 AM, Sik the hedgehog wrote:
|
|||||||||||||||||
|
|
||||||||||||||||||
| I think it's something to do with linking. |
|
Timodor
|
#include "Game.h"
#include <android/log.h> #include <GLES/gl.h> #include <GLES/glext.h> //include <android/asset_manager.h> int main(int argc, char *argv[]) { //Initialize all SDL subsystems if( SDL_Init( SDL_INIT_EVERYTHING ) == -1 ) { return 1; } //Set up the screen //Create Window //if( SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_OPENGL | SDL_FULLSCREEN ) == NULL ) if( SDL_SetVideoMode( 780, 480, 8, SDL_OPENGL) == NULL ) { return false; } SDL_WM_SetCaption( "GUNNER", NULL ); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrthof(0, 780, 480, 0, 0, 1); glMatrixMode(GL_MODELVIEW); bool bGame = true; while (bGame == true) { /* glBegin(GL_QUADS); glVertex2d( 0 , 0 ); glVertex2d( 0 , 10 ); glVertex2d( 10 , 10 ); glVertex2d( 10 , 0 ); glEnd(); */ SDL_GL_SwapBuffers(); } return 0; } ERRORS Description Resource Path Location Type Function 'glLoadIdentity' could not be resolved main.cpp /SDLActivity/jni/src line 34 Semantic Error Type 'glMatrixMode' could not be resolved main.cpp /SDLActivity/jni/src line 36 Semantic Error Type 'glMatrixMode' could not be resolved main.cpp /SDLActivity/jni/src line 33 Semantic Error Function 'glOrthof' could not be resolved main.cpp /SDLActivity/jni/src line 35 Semantic Error I check the OpenGL header's and those functions are in there. Something to do with lib's? |
|||||||||||
|
|
||||||||||||
| Andriod SDL_2.0/OPENGL ES 1.1/NDK Base for Eclipse? |
|
Scott Percival
Guest
|
Are you absolutely sure that you've included GLES/gl.h?
Alternatively it might be some Eclipse code analysis voodoo failing, something like this - http://stackoverflow.com/questions/10041453/eclipse-c-type-could-not-be-resolved-error-even-though-build-is-successful On 28 April 2013 08:10, Timodor wrote:
|
|||||||||||||
|
|
||||||||||||||
|
Timodor
|
Well I finally got OpenGL working but's bizarre. It only complies if you load eclipse from scratch, if you like edit the main.cpp with anything, all of sudden you get those can't resolve this and that. So it works, but you can edit you code, without having to restart the entire eclipse! I suspect it has something to do with NDK.
Something to do with this build command : C:\adt-bundle-windows-x86_64-20130219\android-ndk-r8d\ndk-build |
|||||||||||
|
|
||||||||||||
| Andriod SDL_2.0/OPENGL ES 1.1/NDK Base for Eclipse? |
|
Jonny D
|
If it doesn't make sense, blame Eclipse. That's what I've learned. Restart Eclipse or your computer and it usually works out. ndk-build can be used from the command line too, so you can avoid these problems if you go that route.
Jonny D On Mon, Apr 29, 2013 at 5:58 AM, Timodor wrote:
|
|||||||||||||
|
|
||||||||||||||
| Error |
|
Timodor
|
Well I finally got around it went into the error manager in eclipse and disabled the very error types it now works.
GLAD I have SDL 1.2 and OpenGL ES 1.1 Working |
|||||||||||
|
|
||||||||||||

