}
}
-__attribute__((warn_unused_result))
-static int fb_init( struct framebuffer *fb )
+static void fb_init( struct framebuffer *fb )
{
i32 ix = vg_window_x / fb->div,
iy = vg_window_y / fb->div;
GL_RENDERBUFFER, fb->rb );
glBindFramebuffer( GL_FRAMEBUFFER, 0 );
- if( VG_CHECK_GL_ERR() )
- {
- fb->allocated = 0;
- vg_error( "Error while creating standard framebuffer\n" );
- return 0;
- }
-
+ VG_CHECK_GL_ERR();
fb->allocated = 1;
- return 1;
}
static void fb_free( struct framebuffer *fb )
/*
* Vg
*/
-static int render_init(void)
+static void render_init(void)
{
shader_blit_register();
shader_standard_register();
shader_vblend_register();
shader_unlit_register();
- if( vg_acquire_thread_sync(1) )
+ vg_acquire_thread_sync();
{
vg_info( "Allocating framebuffers\n" );
GL_TEXTURE_2D,
gpipeline.rgb_background, 0);
- if( VG_CHECK_GL_ERR() )
- {
- vg_error( "Error while creating back buffer\n" );
- vg_release_thread_sync(1);
- return 0;
- }
+ VG_CHECK_GL_ERR();
/*
* World depth map, maybe this should be moved to world.h
GL_TEXTURE_2D,
gpipeline.rgb_depthmap, 0);
- if( VG_CHECK_GL_ERR() )
- {
- vg_error( "Error while creating world depth buffer\n" );
- glBindFramebuffer( GL_FRAMEBUFFER, 0 );
- vg_release_thread_sync(1);
- return 0;
- }
+ VG_CHECK_GL_ERR();
float quad[] = { 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f,
0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f };
sizeof(float)*2, (void*)0 );
glEnableVertexAttribArray( 0 );
- if( VG_CHECK_GL_ERR() )
- {
- vg_error( "Error while creating fsquad\n" );
- glBindFramebuffer( GL_FRAMEBUFFER, 0 );
- vg_release_thread_sync(1);
- return 0;
- }
+ VG_CHECK_GL_ERR();
glGenBuffers( 1, &gpipeline.ubo_world_lighting );
glBindBuffer( GL_UNIFORM_BUFFER, gpipeline.ubo_world_lighting );
render_update_lighting_ub();
glBindBufferBase( GL_UNIFORM_BUFFER, 0, gpipeline.ubo_world_lighting );
- if( VG_CHECK_GL_ERR() )
- {
- vg_error( "Error while creating world uniform buffers\n" );
- glBindFramebuffer( GL_FRAMEBUFFER, 0 );
- vg_release_thread_sync(1);
- return 0;
- }
+ VG_CHECK_GL_ERR();
glBindFramebuffer( GL_FRAMEBUFFER, 0 );
vg_success( "Done\n" );
gpipeline.ready = 1;
- vg_release_thread_sync(1);
- return 1;
}
- else
- return 0;
+
+ vg_release_thread_sync();
}
static void render_free(void *_)