Gut raylib usage from the codebase.

Going to either fully commit to sokol or if it fails, rolling the platform layer myself.
This commit is contained in:
2024-05-25 11:52:23 -04:00
parent 13c3032dba
commit 797ab227e9
25 changed files with 571 additions and 1368 deletions

View File

@ -3,11 +3,10 @@ package sectr
// Scratch space
import sokol_gfx "thirdparty:sokol/gfx"
import rl "vendor:raylib"
DebugData :: struct {
square_size : i32,
square_pos : rl.Vector2,
square_pos : Vec2,
debug_text_vis : b32,
draw_debug_text_y : f32,
@ -35,10 +34,6 @@ DebugData :: struct {
lorem_content : []byte,
lorem_parse : PWS_ParseResult,
// Test 3d Viewport
cam_vp : rl.Camera3D,
viewport_rt : rl.RenderTexture,
gfx_clear_demo_pass_action : sokol_gfx.Pass_Action,
gfx_tri_demo_state : struct {
pipeline : sokol_gfx.Pipeline,

View File

@ -6,8 +6,6 @@ import "core:mem"
import "core:mem/virtual"
import "core:os"
import rl "vendor:raylib"
Str_App_State := "App State"
#region("Memory")
@ -167,6 +165,7 @@ AppWindow :: struct {
extent : Extents2, // Window half-size
dpi_scale : f32, // Dots per inch scale (provided by raylib via glfw)
ppcm : f32, // Dots per centimetre
resized : b32, // Extent changed this frame
}
FontData :: struct {
@ -241,9 +240,14 @@ State :: struct {
font_rec_mono_semicasual_reg : FontID,
default_font : FontID,
// Context tracking
// These are used as implicit contextual states when doing immediate mode interfaces
// or for event callbacks that need their context assigned
// There are two potential UI contextes for this prototype so far,
// the screen-space UI and the current workspace UI.
// This is used so that the ui api doesn't need to have the user pass the context every single time.
// This is used so that the ui api doesn't need to have the user pass the context through every proc.
ui_context : ^UI_State,
ui_floating_context : ^UI_FloatingManager,

View File

@ -116,12 +116,12 @@ theme_table_row :: proc( is_even : bool ) -> UI_Theme
if ! loaded
{
app_color := app_color_theme()
table_bg : Color
table_bg : RGBA8
if is_even {
table_bg = app_color.table_even_bg_color
table_bg = app_color.table_even_bg
}
else {
table_bg = app_color.table_odd_bg_color
table_bg = app_color.table_odd_bg
}
layout := UI_Layout {
flags = {},