projects
/
vg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eab2a12
)
maths and bugs
author
hgn
<hgodden00@gmail.com>
Thu, 2 Jun 2022 15:28:50 +0000
(16:28 +0100)
committer
hgn
<hgodden00@gmail.com>
Thu, 2 Jun 2022 15:28:50 +0000
(16:28 +0100)
src/vg/vg_lines.h
patch
|
blob
|
history
src/vg/vg_m.h
patch
|
blob
|
history
src/vg/vg_platform.h
patch
|
blob
|
history
src/vg/vg_shader.h
patch
|
blob
|
history
src/vg/vg_ui.h
patch
|
blob
|
history
diff --git
a/src/vg/vg_lines.h
b/src/vg/vg_lines.h
index f57dd097d370131040acb499b7f10ece9f44dfe3..0263722818b592fa05f4a3db73c1f2f2d80c511c 100644
(file)
--- a/
src/vg/vg_lines.h
+++ b/
src/vg/vg_lines.h
@@
-127,7
+127,6
@@
static void vg_lines_drawall( float* projection )
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glBlendEquation( GL_FUNC_ADD );
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 );
glDrawArrays( GL_LINES, 0, vg_lines.draw_idx );
glDisable( GL_BLEND );
diff --git
a/src/vg/vg_m.h
b/src/vg/vg_m.h
index a61c6f0565575a442a98fa43fb675b3ef2edb834..9f934163e42bd7c5204566eeb11eb637f93e4206 100644
(file)
--- a/
src/vg/vg_m.h
+++ b/
src/vg/vg_m.h
@@
-598,6
+598,13
@@
static inline void m4x3_to_3x3( m4x3f a, m3x3f b )
v3_copy( a[2], b[2] );
}
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 inline void m4x3_copy( m4x3f a, m4x3f b )
{
v3_copy( a[0], b[0] );
diff --git
a/src/vg/vg_platform.h
b/src/vg/vg_platform.h
index 89315b65c86dee6765865811bc47343d5106f127..7e70d81178a9cdb8599165d0249645e3563ac8f8 100644
(file)
--- a/
src/vg/vg_platform.h
+++ b/
src/vg/vg_platform.h
@@
-1,3
+1,6
@@
+#ifndef VG_PLATFORM_H
+#define VG_PLATFORM_H
+
/* Copyright (C) 2021-2022 Harry Godden (hgn) - All Rights Reserved */
typedef uint8_t u8;
/* Copyright (C) 2021-2022 Harry Godden (hgn) - All Rights Reserved */
typedef uint8_t u8;
@@
-107,3
+110,5
@@
int vg_thread_run( void *pfunc, void *data )
}
#endif
}
}
#endif
}
+
+#endif
diff --git
a/src/vg/vg_shader.h
b/src/vg/vg_shader.h
index da611869280c95602c46b005bd2a8eb62bf09cf4..0f1303bc3c540768e3218c57f5047af7c3c3e462 100644
(file)
--- a/
src/vg/vg_shader.h
+++ b/
src/vg/vg_shader.h
@@
-66,17
+66,26
@@
struct vg_shader
static GLuint vg_shader_subshader( const char *src, GLint gliShaderType )
{
GLint shader = glCreateShader( gliShaderType );
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 );
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;
}
return 0;
}
diff --git
a/src/vg/vg_ui.h
b/src/vg/vg_ui.h
index f7f8a1ca791b8253057714ef262ee789ad04ca1d..f36d3630dc7de62e3abb956df39616c8b995f2a9 100644
(file)
--- a/
src/vg/vg_ui.h
+++ b/
src/vg/vg_ui.h
@@
-1,5
+1,8
@@
/* Copyright (C) 2021-2022 Harry Godden (hgn) - All Rights Reserved */
/* 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;"
SHADER_DEFINE( shader_ui,
"layout (location=0) in vec2 a_co;"
@@
-853,3
+856,5
@@
static void ui_push_image( ui_ctx *ctx, ui_rect rc, GLuint image )
#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 )
#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