Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,234 changes: 10 additions & 1,224 deletions gs_core/source/gs_asset.h

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion gs_core/source/gs_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@
*/

#define GS_IMPL
#define GS_NO_SHORT_NAME // avoids gs_core name conflicts
#include <gs/gs.h>

#define GS_IMMEDIATE_DRAW_IMPL
#include <gs/util/gs_idraw.h>

#define GS_GUI_IMPL
#include <gs/util/gs_gui.h>"
#include <gs/util/gs_gui.h>

#define GS_GFXT_IMPL
#include <gs/util/gs_gfxt.h>
Expand Down
4 changes: 2 additions & 2 deletions gs_core/source/gs_graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ int32_t gs_quad_compare(const void* a, const void* b)
typedef struct gs_quad_batch_t
{
gs_dyn_array(gs_quad_t) quads;// Array of quads
gs_vbo vbo; // Vertex buffer handle
gs_ibo ibo; // Index buffer handle
gs_handle(gs_graphics_vertex_buffer_t) vbo; // Vertex buffer handle
gs_handle(gs_graphics_index_buffer_t) ibo; // Index buffer handle
uint32_t material_hndl; // Reference to a material asset
uint32_t count; // Total index buffer count for upload
} gs_quad_batch_t;
Expand Down
2 changes: 1 addition & 1 deletion gs_core/source/proj_gen/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ GS_API_DECL gs_token_t gs_lexer_gen_next_token(gs_lexer_t* lex)
case ')': {t.type = GS_TOKEN_RPAREN; lex->at++;} break;
case '<': {t.type = GS_TOKEN_LTHAN; lex->at++;} break;
case '>': {t.type = GS_TOKEN_GTHAN; lex->at++;} break;
case ';': {t.type = GS_TOKEN_SEMI_COLON; lex->at++;} break;
case ';': {t.type = GS_TOKEN_SEMICOLON; lex->at++;} break;
case ':': {t.type = GS_TOKEN_COLON; lex->at++;} break;
case ',': {t.type = GS_TOKEN_COMMA; lex->at++;} break;
case '=': {t.type = GS_TOKEN_EQUAL; lex->at++;} break;
Expand Down
12 changes: 6 additions & 6 deletions gs_core/source/proj_gen/templates/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ GS_API_DECL void %APP_NAME%_shutdown();
GS_API_DECL void %APP_NAME%_init()
{
// Initialize core
%APP_NAME%_t* app = gs_engine_user_data(%APP_NAME%_t);
%APP_NAME%_t* app = gs_user_data(%APP_NAME%_t);
app->core = gs_core_new();

// Register reflection for %APP_NAME%
Expand All @@ -42,7 +42,7 @@ GS_API_DECL void %APP_NAME%_init()
GS_API_DECL void %APP_NAME%_update()
{
// Cache app/core pointers
%APP_NAME%_t* app = gs_engine_user_data(%APP_NAME%_t);
%APP_NAME%_t* app = gs_user_data(%APP_NAME%_t);
gs_core_t* core = app->core;
gs_command_buffer_t* cb = &core->cb;
gs_immediate_draw_t* gsi = &core->gsi;
Expand All @@ -54,7 +54,7 @@ GS_API_DECL void %APP_NAME%_update()
const gs_vec2 ws = gs_platform_window_sizev(gs_platform_main_window());

// Process input (closing window)
if (gs_platform_key_pressed(GS_KEYCODE_ESC)) gs_engine_quit();
if (gs_platform_key_pressed(GS_KEYCODE_ESC)) gs_quit();

// Update entity manager
gs_entities_update(em);
Expand All @@ -69,15 +69,15 @@ GS_API_DECL void %APP_NAME%_update()
gsi_rectvd(gsi, gs_v2(150.f, 150.f), gs_v2(500.f, 500.f * 0.18f), gs_v2s(0.f), gs_v2s(1.f), GS_COLOR_WHITE, GS_GRAPHICS_PRIMITIVE_TRIANGLES);

// Submit immediate draw render pass
gsi_render_pass_submit(gsi, cb, gs_color(10, 10, 10, 255));
gsi_renderpass_submit(gsi, cb, gs_color(10, 10, 10, 255));

// Submit command buffer for rendering
gs_graphics_submit_command_buffer(cb);
gs_graphics_command_buffer_submit(cb);
}

GS_API_DECL void %APP_NAME%_shutdown()
{
%APP_NAME%_t* app = gs_engine_user_data(%APP_NAME%_t);
%APP_NAME%_t* app = gs_user_data(%APP_NAME%_t);
gs_core_delete(app->core);
}

Expand Down
8 changes: 4 additions & 4 deletions gs_core/source/reflection/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,15 +569,15 @@ void parse_struct_field(reflection_data_t* refl, meta_class_t* c, gs_lexer_t* le
memcpy(p.name, t.text, t.len);

// Require semi colon
if (!gs_lexer_find_next_token_type(lex, GS_TOKEN_SEMI_COLON)) gs_assert(false);
if (!gs_lexer_find_next_token_type(lex, GS_TOKEN_SEMICOLON)) gs_assert(false);

// Add to class properties
gs_dyn_array_push(c->properties, p);
}
else
{
// Move to the semicolon
gs_lexer_find_next_token_type(lex, GS_TOKEN_SEMI_COLON);
gs_lexer_find_next_token_type(lex, GS_TOKEN_SEMICOLON);
}
}

Expand Down Expand Up @@ -615,7 +615,7 @@ void parse_struct(reflection_data_t* refl, gs_lexer_t* lex)
}

// Parse to semi colon (if identifier found, store name)
while (lex->can_lex(lex) && t.type != GS_TOKEN_SEMI_COLON)
while (lex->can_lex(lex) && t.type != GS_TOKEN_SEMICOLON)
{
t = lex->next_token(lex);
switch (t.type)
Expand Down Expand Up @@ -674,7 +674,7 @@ void parse_enum(reflection_data_t* refl, gs_lexer_t* lex)
}

// Find semi colon
while (lex->can_lex(lex) && t.type != GS_TOKEN_SEMI_COLON)
while (lex->can_lex(lex) && t.type != GS_TOKEN_SEMICOLON)
{
t = lex->next_token(lex);
switch (t.type)
Expand Down
Binary file removed gs_editor/bin/Reflection.ilk
Binary file not shown.
Binary file removed gs_editor/bin/Reflection.pdb
Binary file not shown.
Binary file removed gs_editor/bin/gs_editor.ilk
Binary file not shown.
Binary file removed gs_editor/bin/gs_editor.pdb
Binary file not shown.
Binary file removed gs_editor/bin/gs_editor_main.obj
Binary file not shown.
Binary file removed gs_editor/bin/main.obj
Binary file not shown.
Binary file removed gs_editor/bin/vc140.pdb
Binary file not shown.
Loading