mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 05:48:40 +00:00
os gfx stub backend
This commit is contained in:
@@ -0,0 +1,223 @@
|
|||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: @os_hooks Main Initialization API (Implemented Per-OS)
|
||||||
|
|
||||||
|
internal void
|
||||||
|
os_graphical_init(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: @os_hooks Clipboards (Implemented Per-OS)
|
||||||
|
|
||||||
|
internal void
|
||||||
|
os_set_clipboard_text(String8 string)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
internal String8
|
||||||
|
os_get_clipboard_text(Arena *arena)
|
||||||
|
{
|
||||||
|
return str8_zero();
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: @os_hooks Windows (Implemented Per-OS)
|
||||||
|
|
||||||
|
internal OS_Handle
|
||||||
|
os_window_open(Vec2F32 resolution, String8 title)
|
||||||
|
{
|
||||||
|
OS_Handle handle = {1};
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void
|
||||||
|
os_window_close(OS_Handle window)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void
|
||||||
|
os_window_first_paint(OS_Handle window)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void
|
||||||
|
os_window_equip_repaint(OS_Handle window, OS_WindowRepaintFunctionType *repaint, void *user_data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void
|
||||||
|
os_window_focus(OS_Handle window)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
internal B32
|
||||||
|
os_window_is_focused(OS_Handle window)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal B32
|
||||||
|
os_window_is_fullscreen(OS_Handle window)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void
|
||||||
|
os_window_set_fullscreen(OS_Handle window, B32 fullscreen)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
internal B32
|
||||||
|
os_window_is_maximized(OS_Handle window)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void
|
||||||
|
os_window_set_maximized(OS_Handle window, B32 maximized)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void
|
||||||
|
os_window_bring_to_front(OS_Handle window)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void
|
||||||
|
os_window_set_monitor(OS_Handle window, OS_Handle monitor)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
internal Rng2F32
|
||||||
|
os_rect_from_window(OS_Handle window)
|
||||||
|
{
|
||||||
|
Rng2F32 rect = r2f32(v2f32(0, 0), v2f32(500, 500));
|
||||||
|
return rect;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal Rng2F32
|
||||||
|
os_client_rect_from_window(OS_Handle window)
|
||||||
|
{
|
||||||
|
Rng2F32 rect = r2f32(v2f32(0, 0), v2f32(500, 500));
|
||||||
|
return rect;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal F32
|
||||||
|
os_dpi_from_window(OS_Handle window)
|
||||||
|
{
|
||||||
|
return 96.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: @os_hooks Monitors (Implemented Per-OS)
|
||||||
|
|
||||||
|
internal OS_HandleArray
|
||||||
|
os_push_monitors_array(Arena *arena)
|
||||||
|
{
|
||||||
|
OS_HandleArray arr = {0};
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal OS_Handle
|
||||||
|
os_primary_monitor(void)
|
||||||
|
{
|
||||||
|
OS_Handle handle = {1};
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal OS_Handle
|
||||||
|
os_monitor_from_window(OS_Handle window)
|
||||||
|
{
|
||||||
|
OS_Handle handle = {1};
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal String8
|
||||||
|
os_name_from_monitor(Arena *arena, OS_Handle monitor)
|
||||||
|
{
|
||||||
|
return str8_zero();
|
||||||
|
}
|
||||||
|
|
||||||
|
internal Vec2F32
|
||||||
|
os_dim_from_monitor(OS_Handle monitor)
|
||||||
|
{
|
||||||
|
Vec2F32 v = v2f32(1000, 1000);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: @os_hooks Events (Implemented Per-OS)
|
||||||
|
|
||||||
|
internal void
|
||||||
|
os_send_wakeup_event(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
internal OS_EventList
|
||||||
|
os_get_events(Arena *arena, B32 wait)
|
||||||
|
{
|
||||||
|
OS_EventList evts = {0};
|
||||||
|
return evts;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal OS_EventFlags
|
||||||
|
os_get_event_flags(void)
|
||||||
|
{
|
||||||
|
OS_EventFlags f = 0;
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal B32
|
||||||
|
os_key_is_down(OS_Key key)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal Vec2F32
|
||||||
|
os_mouse_from_window(OS_Handle window)
|
||||||
|
{
|
||||||
|
return v2f32(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: @os_hooks Cursors (Implemented Per-OS)
|
||||||
|
|
||||||
|
internal void
|
||||||
|
os_set_cursor(OS_Cursor cursor)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: @os_hooks System Properties (Implemented Per-OS)
|
||||||
|
|
||||||
|
internal F32
|
||||||
|
os_double_click_time(void)
|
||||||
|
{
|
||||||
|
return 1.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal F32
|
||||||
|
os_caret_blink_time(void)
|
||||||
|
{
|
||||||
|
return 1.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal F32
|
||||||
|
os_default_refresh_rate(void)
|
||||||
|
{
|
||||||
|
return 60.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal B32
|
||||||
|
os_granular_sleep_enabled(void)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: @os_hooks Native Messages & Panics (Implemented Per-OS)
|
||||||
|
|
||||||
|
internal void
|
||||||
|
os_graphical_message(B32 error, String8 title, String8 message)
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
// Copyright (c) 2024 Epic Games Tools
|
||||||
|
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||||
|
|
||||||
|
#ifndef OS_GFX_STUB_H
|
||||||
|
#define OS_GFX_STUB_H
|
||||||
|
|
||||||
|
#endif // OS_GFX_STUB_H
|
||||||
+5
-1
@@ -19,7 +19,7 @@
|
|||||||
# if OS_FEATURE_SOCKET
|
# if OS_FEATURE_SOCKET
|
||||||
# include "socket/win32/os_socket_win32.c"
|
# include "socket/win32/os_socket_win32.c"
|
||||||
# endif
|
# endif
|
||||||
# if OS_FEATURE_GRAPHICAL
|
# if OS_FEATURE_GRAPHICAL && !OS_GFX_STUB
|
||||||
# include "gfx/win32/os_gfx_win32.c"
|
# include "gfx/win32/os_gfx_win32.c"
|
||||||
# endif
|
# endif
|
||||||
#elif OS_LINUX
|
#elif OS_LINUX
|
||||||
@@ -27,3 +27,7 @@
|
|||||||
#else
|
#else
|
||||||
# error no OS layer setup
|
# error no OS layer setup
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if OS_GFX_STUB
|
||||||
|
#include "gfx/stub/os_gfx_stub.c"
|
||||||
|
#endif
|
||||||
|
|||||||
+9
-1
@@ -12,6 +12,10 @@
|
|||||||
# define OS_FEATURE_GRAPHICAL 0
|
# define OS_FEATURE_GRAPHICAL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(OS_GFX_STUB)
|
||||||
|
# define OS_GFX_STUB 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "core/os_core.h"
|
#include "core/os_core.h"
|
||||||
|
|
||||||
#if OS_FEATURE_SOCKET
|
#if OS_FEATURE_SOCKET
|
||||||
@@ -27,7 +31,7 @@
|
|||||||
# if OS_FEATURE_SOCKET
|
# if OS_FEATURE_SOCKET
|
||||||
# include "socket/win32/os_socket_win32.h"
|
# include "socket/win32/os_socket_win32.h"
|
||||||
# endif
|
# endif
|
||||||
# if OS_FEATURE_GRAPHICAL
|
# if OS_FEATURE_GRAPHICAL && !OS_GFX_STUB
|
||||||
# include "gfx/win32/os_gfx_win32.h"
|
# include "gfx/win32/os_gfx_win32.h"
|
||||||
# endif
|
# endif
|
||||||
#elif OS_LINUX
|
#elif OS_LINUX
|
||||||
@@ -36,4 +40,8 @@
|
|||||||
# error no OS layer setup
|
# error no OS layer setup
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if OS_GFX_STUB
|
||||||
|
#include "gfx/stub/os_gfx_stub.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif //OS_SWITCH_H
|
#endif //OS_SWITCH_H
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: Includes
|
//~ rjf: Includes
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#if LANG_CPP
|
#if LANG_CPP
|
||||||
# if R_BACKEND == R_BACKEND_STUB
|
# if R_BACKEND == R_BACKEND_STUB
|
||||||
# include "stub/render_stub.cpp"
|
# include "stub/render_stub.c"
|
||||||
# elif R_BACKEND == R_BACKEND_D3D11
|
# elif R_BACKEND == R_BACKEND_D3D11
|
||||||
# include "d3d11/render_d3d11.cpp"
|
# include "d3d11/render_d3d11.cpp"
|
||||||
# else
|
# else
|
||||||
|
|||||||
Reference in New Issue
Block a user