glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glBlendEquation( GL_FUNC_ADD );
-
glDrawArrays( GL_LINES, 0, vg_lines.draw_idx );
glDisable( GL_BLEND );
v3_copy( a[2], b[2] );
}
+static inline void m4x3_invert_affine( m4x3f a, m4x3f b )
+{
+ m3x3_transpose( a, b );
+ m3x3_mulv( b, a[3], b[3] );
+ v3_negate( b[3], b[3] );
+}
+
static inline void m4x3_copy( m4x3f a, m4x3f b )
{
v3_copy( a[0], b[0] );
static GLuint vg_shader_subshader( const char *src, GLint gliShaderType )
{
GLint shader = glCreateShader( gliShaderType );
+
+ if( shader == GL_NONE )
+ {
+ vg_error( "Could not 'glCreateShader()'\n" );
+ return 0;
+ }
+
glShaderSource( shader, 2, (const char *[2]){ vg_shader_gl_ver, src }, NULL );
glCompileShader( shader );
- int success;
- char infoLog[512];
- glGetShaderiv( shader, GL_COMPILE_STATUS, &success );
+ GLint status;
+ glGetShaderiv( shader, GL_COMPILE_STATUS, &status );
- if( !success )
+ if( status != GL_TRUE )
{
- glGetShaderInfoLog( shader, 512, NULL, infoLog );
- vg_error( "Error info:\n%s\n", infoLog );
+ GLchar info[1024];
+ GLsizei len;
+
+ glGetShaderInfoLog( shader, sizeof(info), &len, info );
+ vg_error( "Error info:\n%s\n", info );
return 0;
}
/* Copyright (C) 2021-2022 Harry Godden (hgn) - All Rights Reserved */
+#ifndef VG_UI_H
+#define VG_UI_H
+
SHADER_DEFINE( shader_ui,
"layout (location=0) in vec2 a_co;"
#define gui_want_mouse() ui_want_mouse( &ui_global_ctx )
#define gui_push_image(...) ui_push_image( &ui_global_ctx, __VA_ARGS__ )
#define gui_reset_colours(...) ui_reset_colours( &ui_global_ctx )
+
+#endif