|
|
@@ -60,6 +60,8 @@ set_window_size :: proc(width: int, height: int)
|
|
|
// uses a blank, white texture. For the same reasons as (1), drawing something else than shapes
|
|
|
// before drawing a shape will break up the batches. TODO: Add possibility to customize shape
|
|
|
// drawing texture so that you can put it into an atlas.
|
|
|
+//
|
|
|
+// TODO: Name of this proc? submit_current_batch, flush_current_batch, draw_current_batch
|
|
|
draw_current_batch :: proc()
|
|
|
|
|
|
//-------//
|
|
|
@@ -153,9 +155,6 @@ set_internal_state :: proc(state: ^State)
|
|
|
// TYPES AND CONSTANTS //
|
|
|
//---------------------//
|
|
|
|
|
|
-// A RGBA (Red, Greeen, Blue, Alpha) color. Each channel can have a value between 0 and 255.
|
|
|
-Color :: [4]u8
|
|
|
-
|
|
|
// A two dimensinal vector.
|
|
|
Vec2 :: [2]f32
|
|
|
|
|
|
@@ -174,6 +173,42 @@ Rect :: struct {
|
|
|
w, h: f32,
|
|
|
}
|
|
|
|
|
|
+// An RGBA (Red, Green, Blue, Alpha) color. Each channel can have a value between 0 and 255.
|
|
|
+Color :: [4]u8
|
|
|
+
|
|
|
+WHITE :: Color { 255, 255, 255, 255 }
|
|
|
+BLACK :: Color { 0, 0, 0, 255 }
|
|
|
+BLANK :: Color { 0, 0, 0, 0 }
|
|
|
+BLUE :: Color { 30, 116, 240, 255 }
|
|
|
+
|
|
|
+// These are from Raylib. They are here so you can easily port a Raylib program to Karl2D.
|
|
|
+RL_LIGHTGRAY :: Color { 200, 200, 200, 255 }
|
|
|
+RL_GRAY :: Color { 130, 130, 130, 255 }
|
|
|
+RL_DARKGRAY :: Color { 80, 80, 80, 255 }
|
|
|
+RL_YELLOW :: Color { 253, 249, 0, 255 }
|
|
|
+RL_GOLD :: Color { 255, 203, 0, 255 }
|
|
|
+RL_ORANGE :: Color { 255, 161, 0, 255 }
|
|
|
+RL_PINK :: Color { 255, 109, 194, 255 }
|
|
|
+RL_RED :: Color { 230, 41, 55, 255 }
|
|
|
+RL_MAROON :: Color { 190, 33, 55, 255 }
|
|
|
+RL_GREEN :: Color { 0, 228, 48, 255 }
|
|
|
+RL_LIME :: Color { 0, 158, 47, 255 }
|
|
|
+RL_DARKGREEN :: Color { 0, 117, 44, 255 }
|
|
|
+RL_SKYBLUE :: Color { 102, 191, 255, 255 }
|
|
|
+RL_BLUE :: Color { 0, 121, 241, 255 }
|
|
|
+RL_DARKBLUE :: Color { 0, 82, 172, 255 }
|
|
|
+RL_PURPLE :: Color { 200, 122, 255, 255 }
|
|
|
+RL_VIOLET :: Color { 135, 60, 190, 255 }
|
|
|
+RL_DARKPURPLE :: Color { 112, 31, 126, 255 }
|
|
|
+RL_BEIGE :: Color { 211, 176, 131, 255 }
|
|
|
+RL_BROWN :: Color { 127, 106, 79, 255 }
|
|
|
+RL_DARKBROWN :: Color { 76, 63, 47, 255 }
|
|
|
+RL_WHITE :: WHITE
|
|
|
+RL_BLACK :: BLACK
|
|
|
+RL_BLANK :: BLANK
|
|
|
+RL_MAGENTA :: Color { 255, 0, 255, 255 }
|
|
|
+RL_RAYWHITE :: Color { 245, 245, 245, 255 }
|
|
|
+
|
|
|
Texture :: struct {
|
|
|
handle: Texture_Handle,
|
|
|
width: int,
|
|
|
@@ -306,38 +341,6 @@ Mouse_Button :: enum {
|
|
|
Max = 255,
|
|
|
}
|
|
|
|
|
|
-WHITE :: Color { 255, 255, 255, 255 }
|
|
|
-BLACK :: Color { 0, 0, 0, 255 }
|
|
|
-BLANK :: Color { 0, 0, 0, 0}
|
|
|
-
|
|
|
-// These are from Raylib. They are here so you can easily port a Raylib program to Karl2D.
|
|
|
-RL_LIGHTGRAY :: Color { 200, 200, 200, 255 }
|
|
|
-RL_GRAY :: Color { 130, 130, 130, 255 }
|
|
|
-RL_DARKGRAY :: Color { 80, 80, 80, 255 }
|
|
|
-RL_YELLOW :: Color { 253, 249, 0, 255 }
|
|
|
-RL_GOLD :: Color { 255, 203, 0, 255 }
|
|
|
-RL_ORANGE :: Color { 255, 161, 0, 255 }
|
|
|
-RL_PINK :: Color { 255, 109, 194, 255 }
|
|
|
-RL_RED :: Color { 230, 41, 55, 255 }
|
|
|
-RL_MAROON :: Color { 190, 33, 55, 255 }
|
|
|
-RL_GREEN :: Color { 0, 228, 48, 255 }
|
|
|
-RL_LIME :: Color { 0, 158, 47, 255 }
|
|
|
-RL_DARKGREEN :: Color { 0, 117, 44, 255 }
|
|
|
-RL_SKYBLUE :: Color { 102, 191, 255, 255 }
|
|
|
-RL_BLUE :: Color { 0, 121, 241, 255 }
|
|
|
-RL_DARKBLUE :: Color { 0, 82, 172, 255 }
|
|
|
-RL_PURPLE :: Color { 200, 122, 255, 255 }
|
|
|
-RL_VIOLET :: Color { 135, 60, 190, 255 }
|
|
|
-RL_DARKPURPLE :: Color { 112, 31, 126, 255 }
|
|
|
-RL_BEIGE :: Color { 211, 176, 131, 255 }
|
|
|
-RL_BROWN :: Color { 127, 106, 79, 255 }
|
|
|
-RL_DARKBROWN :: Color { 76, 63, 47, 255 }
|
|
|
-RL_WHITE :: WHITE
|
|
|
-RL_BLACK :: BLACK
|
|
|
-RL_BLANK :: BLANK
|
|
|
-RL_MAGENTA :: Color { 255, 0, 255, 255 }
|
|
|
-RL_RAYWHITE :: Color { 245, 245, 245, 255 }
|
|
|
-
|
|
|
// Based on Raylib / GLFW
|
|
|
Keyboard_Key :: enum {
|
|
|
None = 0,
|