Commit 6c47c709 authored by Ilya Prokhorov's avatar Ilya Prokhorov

ES OpenGL Mode for android build

parent 4e500744
......@@ -304,7 +304,21 @@ SDL_Window* OGLNewAgeRenderer::initializeWindow(shared_ptr<IOSystemParams> param
{
flags = flags | SDL_WINDOW_FULLSCREEN_DESKTOP;
}
#if CUBE_ART_PROJECT_ANDROID_NDK_BUILD == 1
SDL_DisplayMode mode;
SDL_GetDisplayMode(0,0,&mode);
width = mode.w;
height = mode.h;
window = SDL_CreateWindow(
title,
0,
0,
width,
height,
SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN | SDL_WINDOW_RESIZABLE
);
#else
window = SDL_CreateWindow(
title,
SDL_WINDOWPOS_UNDEFINED,
......@@ -313,7 +327,8 @@ SDL_Window* OGLNewAgeRenderer::initializeWindow(shared_ptr<IOSystemParams> param
height,
flags
);
#endif
if (window == NULL)
{
......@@ -334,7 +349,11 @@ SDL_Window* OGLNewAgeRenderer::initializeWindow(shared_ptr<IOSystemParams> param
SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION, majorVersion);
SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION, minorVersion);
#if CUBE_ART_PROJECT_ANDROID_NDK_BUILD == 1
SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES );
#else
SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE );
#endif
#endif
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
......@@ -393,7 +412,7 @@ SDL_Window* OGLNewAgeRenderer::initializeWindow(shared_ptr<IOSystemParams> param
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
glViewport(0, 0, width, height);
shader_program = common_get_shader_program(vertexShaderSource, fragmentShaderSource);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment