Set some nicer Graphics3D context attributes to allow the GLES backend more flexibility when choosing a context

This commit is contained in:
Cameron Gutman 2016-02-26 17:20:10 -05:00
parent 4f6c547e47
commit abe66c7e21

View File

@ -76,20 +76,21 @@ void MoonlightInstance::InitializeRenderingSurface(int width, int height) {
} }
int32_t contextAttributes[] = { int32_t contextAttributes[] = {
PP_GRAPHICS3DATTRIB_ALPHA_SIZE, 8,
PP_GRAPHICS3DATTRIB_BLUE_SIZE, 8, PP_GRAPHICS3DATTRIB_BLUE_SIZE, 8,
PP_GRAPHICS3DATTRIB_GREEN_SIZE, 8, PP_GRAPHICS3DATTRIB_GREEN_SIZE, 8,
PP_GRAPHICS3DATTRIB_RED_SIZE, 8, PP_GRAPHICS3DATTRIB_RED_SIZE, 8,
PP_GRAPHICS3DATTRIB_DEPTH_SIZE, 0,
PP_GRAPHICS3DATTRIB_STENCIL_SIZE, 0,
PP_GRAPHICS3DATTRIB_SAMPLES, 0,
PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS, 0,
PP_GRAPHICS3DATTRIB_WIDTH, width, PP_GRAPHICS3DATTRIB_WIDTH, width,
PP_GRAPHICS3DATTRIB_HEIGHT, height, PP_GRAPHICS3DATTRIB_HEIGHT, height,
PP_GRAPHICS3DATTRIB_NONE PP_GRAPHICS3DATTRIB_NONE
}; };
g_Instance->m_Graphics3D = pp::Graphics3D(this, contextAttributes); g_Instance->m_Graphics3D = pp::Graphics3D(this, contextAttributes);
int32_t swapBehaviorAttribute[] = {
PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR, PP_GRAPHICS3DATTRIB_BUFFER_DESTROYED,
PP_GRAPHICS3DATTRIB_NONE
};
g_Instance->m_Graphics3D.SetAttribs(swapBehaviorAttribute);
if (!BindGraphics(m_Graphics3D)) { if (!BindGraphics(m_Graphics3D)) {
fprintf(stderr, "Unable to bind 3d context!\n"); fprintf(stderr, "Unable to bind 3d context!\n");
m_Graphics3D = pp::Graphics3D(); m_Graphics3D = pp::Graphics3D();