static void _init_gl(Evas_Object *obj) { GLData *gld = evas_object_data_get(obj, "gld"); gears_init(gld); }
static DFBResult InitGL( Test *test ) { DFBResult ret; /* * Bind the OpenGL rendering context to our primary surface */ ret = test->gl2context->Bind( test->gl2context, test->primary, test->primary ); if (ret) { D_DERROR( ret, "IDirectFBGL2Context::Bind() failed!\n" ); return ret; } gears_init(); /* Update the projection matrix */ perspective(ProjectionMatrix, 60.0, test->size.w / (float)test->size.h, 1.0, 1024.0); /* Setup the viewport */ glViewport( 0, 0, (GLint) test->size.w, (GLint) test->size.h ); /* Unbind the OpenGL rendering context */ test->gl2context->Unbind( test->gl2context ); return DFB_OK; }
static DFBResult InitGL( Test *test ) { DFBResult ret; /* * Bind the OpenGL rendering context to our primary surface */ ret = test->gl2context->Bind( test->gl2context, test->primary, test->primary ); if (ret) { D_DERROR( ret, "IDirectFBGL2Context::Bind() failed!\n" ); return ret; } gears_init(); /* Unbind the OpenGL rendering context */ test->gl2context->Unbind( test->gl2context ); return DFB_OK; }
int main(int argc, char *argv[]) { /* Initialize the window */ eglutInitWindowSize(300, 300); eglutInitAPIMask(EGLUT_OPENGL_ES2_BIT); eglutInit(argc, argv); eglutCreateWindow("es2gears"); /* Set up eglut callback functions */ eglutIdleFunc(gears_idle); eglutReshapeFunc(gears_reshape); eglutDisplayFunc(gears_draw); eglutSpecialFunc(gears_special); /* Initialize the gears */ gears_init(); eglutMainLoop(); return 0; }
int main(int argc, char *argv[]) { /* Initialize the window */ glutInit(&argc, argv); glutInitWindowSize(300, 300); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutCreateWindow("es2gears"); /* Set up glut callback functions */ gears_idle(); glutReshapeFunc(gears_reshape); glutDisplayFunc(gears_draw); glutSpecialFunc(gears_special); /* Initialize the gears */ gears_init(); glutMainLoop(); return 0; }
int main (int argc, char **argv) { Data data; CoglOnscreen *onscreen; GError *error = NULL; GSource *cogl_source; GMainLoop *loop; CoglRenderer *renderer; CoglDisplay *display; renderer = cogl_renderer_new (); cogl_renderer_add_constraint (renderer, COGL_RENDERER_CONSTRAINT_SUPPORTS_COGL_GLES2); display = cogl_display_new (renderer, NULL); data.ctx = cogl_context_new (display, NULL); onscreen = cogl_onscreen_new (data.ctx, 300, 300); cogl_onscreen_show (onscreen); data.fb = COGL_FRAMEBUFFER (onscreen); data.gles2_ctx = cogl_gles2_context_new (data.ctx, &error); if (!data.gles2_ctx) g_error ("Failed to create GLES2 context: %s\n", error->message); /* Draw scene with GLES2 */ if (!cogl_push_gles2_context (data.ctx, data.gles2_ctx, data.fb, data.fb, &error)) { g_error ("Failed to push gles2 context: %s\n", error->message); } gears_reshape (cogl_framebuffer_get_width (data.fb), cogl_framebuffer_get_height (data.fb)); /* Initialize the gears */ gears_init(); cogl_pop_gles2_context (data.ctx); cogl_source = cogl_glib_source_new (data.ctx, G_PRIORITY_DEFAULT); g_source_attach (cogl_source, NULL); if (cogl_has_feature (data.ctx, COGL_FEATURE_ID_SWAP_BUFFERS_EVENT)) cogl_onscreen_add_swap_buffers_callback (COGL_ONSCREEN (data.fb), swap_complete_cb, &data); g_idle_add (paint_cb, &data); data.timer = g_timer_new (); data.frames = 0; data.last_elapsed = 0; loop = g_main_loop_new (NULL, TRUE); g_main_loop_run (loop); return 0; }
void rsxgltest_init(int argc,const char ** argv) { gears_init(); gears_reshape(rsxgltest_width,rsxgltest_height); }