mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-10-05 23:45:42 +00:00
os -> wm; *_w32_ -> w32_*_, *_lnx_ -> lnx_*_
This commit is contained in:
@@ -198,7 +198,7 @@ r_init(CmdLine *cmdln)
|
||||
{
|
||||
char buffer[256] = {0};
|
||||
raddbg_snprintf(buffer, sizeof(buffer), "D3D11 device creation failure (%lx). The process is terminating.", error);
|
||||
os_graphical_message(1, str8_lit("Fatal Error"), str8_cstring(buffer));
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_cstring(buffer));
|
||||
abort_self(1);
|
||||
}
|
||||
ProfEnd();
|
||||
@@ -370,7 +370,7 @@ r_init(CmdLine *cmdln)
|
||||
{
|
||||
errors = str8((U8 *)vshad_source_errors->lpVtbl->GetBufferPointer(vshad_source_errors),
|
||||
(U64)vshad_source_errors->lpVtbl->GetBufferSize(vshad_source_errors));
|
||||
os_graphical_message(1, str8_lit("Vertex Shader Compilation Failure"), errors);
|
||||
wm_graphical_message(1, str8_lit("Vertex Shader Compilation Failure"), errors);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -425,7 +425,7 @@ r_init(CmdLine *cmdln)
|
||||
{
|
||||
errors = str8((U8 *)pshad_source_errors->lpVtbl->GetBufferPointer(pshad_source_errors),
|
||||
(U64)pshad_source_errors->lpVtbl->GetBufferSize(pshad_source_errors));
|
||||
os_graphical_message(1, str8_lit("Pixel Shader Compilation Failure"), errors);
|
||||
wm_graphical_message(1, str8_lit("Pixel Shader Compilation Failure"), errors);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -483,7 +483,7 @@ r_init(CmdLine *cmdln)
|
||||
//- rjf: window setup/teardown
|
||||
|
||||
r_hook R_Handle
|
||||
r_window_equip(OS_Window handle)
|
||||
r_window_equip(WM_Window handle)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
R_Handle result = {0};
|
||||
@@ -509,8 +509,8 @@ r_window_equip(OS_Window handle)
|
||||
//- rjf: map os window handle -> hwnd
|
||||
HWND hwnd = {0};
|
||||
{
|
||||
OS_W32_Window *w32_layer_window = os_w32_window_from_handle(handle);
|
||||
hwnd = os_w32_hwnd_from_window(w32_layer_window);
|
||||
W32_WM_Window *w32_layer_window = w32_wm_window_from_handle(handle);
|
||||
hwnd = w32_wm_hwnd_from_window(w32_layer_window);
|
||||
}
|
||||
|
||||
//- rjf: create swapchain
|
||||
@@ -534,7 +534,7 @@ r_window_equip(OS_Window handle)
|
||||
{
|
||||
char buffer[256] = {0};
|
||||
raddbg_snprintf(buffer, sizeof(buffer), "DXGI swap chain creation failure (%lx). The process is terminating.", error);
|
||||
os_graphical_message(1, str8_lit("Fatal Error"), str8_cstring(buffer));
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_cstring(buffer));
|
||||
abort_self(1);
|
||||
}
|
||||
|
||||
@@ -556,7 +556,7 @@ r_window_equip(OS_Window handle)
|
||||
}
|
||||
|
||||
r_hook void
|
||||
r_window_unequip(OS_Window handle, R_Handle equip_handle)
|
||||
r_window_unequip(WM_Window handle, R_Handle equip_handle)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
MutexScopeW(r_d3d11_state->device_rw_mutex)
|
||||
@@ -861,7 +861,7 @@ r_end_frame(void)
|
||||
}
|
||||
|
||||
r_hook void
|
||||
r_window_begin_frame(OS_Window window, R_Handle window_equip)
|
||||
r_window_begin_frame(WM_Window window, R_Handle window_equip)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
MutexScopeW(r_d3d11_state->device_rw_mutex)
|
||||
@@ -870,7 +870,7 @@ r_window_begin_frame(OS_Window window, R_Handle window_equip)
|
||||
ID3D11DeviceContext1 *d_ctx = r_d3d11_state->device_ctx;
|
||||
|
||||
//- rjf: get resolution
|
||||
Rng2F32 client_rect = os_client_rect_from_window(window);
|
||||
Rng2F32 client_rect = wm_client_rect_from_window(window);
|
||||
Vec2S32 resolution = {(S32)(client_rect.x1 - client_rect.x0), (S32)(client_rect.y1 - client_rect.y0)};
|
||||
|
||||
//- rjf: resolution change
|
||||
@@ -993,7 +993,7 @@ r_window_begin_frame(OS_Window window, R_Handle window_equip)
|
||||
}
|
||||
|
||||
r_hook void
|
||||
r_window_end_frame(OS_Window window, R_Handle window_equip)
|
||||
r_window_end_frame(WM_Window window, R_Handle window_equip)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
MutexScopeW(r_d3d11_state->device_rw_mutex)
|
||||
@@ -1052,7 +1052,7 @@ r_window_end_frame(OS_Window window, R_Handle window_equip)
|
||||
{
|
||||
char buffer[256] = {0};
|
||||
raddbg_snprintf(buffer, sizeof(buffer), "D3D11 present failure (%lx). The process is terminating.", error);
|
||||
os_graphical_message(1, str8_lit("Fatal Error"), str8_cstring(buffer));
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_cstring(buffer));
|
||||
abort_self(1);
|
||||
}
|
||||
d_ctx->lpVtbl->ClearState(d_ctx);
|
||||
@@ -1063,7 +1063,7 @@ r_window_end_frame(OS_Window window, R_Handle window_equip)
|
||||
//- rjf: render pass submission
|
||||
|
||||
r_hook void
|
||||
r_window_submit(OS_Window window, R_Handle window_equip, R_PassList *passes)
|
||||
r_window_submit(WM_Window window, R_Handle window_equip, R_PassList *passes)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
MutexScopeW(r_d3d11_state->device_rw_mutex)
|
||||
|
||||
@@ -23,7 +23,7 @@ r_ogl_os_init(CmdLine *cmdln)
|
||||
r_ogl_lnx_state->display = eglGetDisplay((EGLNativeDisplayType)os_lnx_gfx_state->display);
|
||||
if(r_ogl_lnx_state->display == EGL_NO_DISPLAY)
|
||||
{
|
||||
os_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Failed to get EGL display."));
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Failed to get EGL display."));
|
||||
abort_self(1);
|
||||
}
|
||||
}
|
||||
@@ -33,14 +33,14 @@ r_ogl_os_init(CmdLine *cmdln)
|
||||
EGLint egl_version_minor = 0;
|
||||
if(!eglInitialize(r_ogl_lnx_state->display, &egl_version_major, &egl_version_minor))
|
||||
{
|
||||
os_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't initialize EGL display."));
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't initialize EGL display."));
|
||||
abort_self(1);
|
||||
}
|
||||
if(egl_version_major < 1 || (egl_version_major == 1 && egl_version_minor < 5))
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
String8 message = push_str8f(scratch.arena, "Unsupported EGL version (%i.%i, need at least 1.5)", egl_version_major, egl_version_minor);
|
||||
os_graphical_message(1, str8_lit("Fatal Error"), message);
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), message);
|
||||
abort_self(1);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
@@ -48,7 +48,7 @@ r_ogl_os_init(CmdLine *cmdln)
|
||||
//- rjf: pick GL API
|
||||
if(!eglBindAPI(EGL_OPENGL_API))
|
||||
{
|
||||
os_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't initialize EGL API to OpenGL."));
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't initialize EGL API to OpenGL."));
|
||||
abort_self(1);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ r_ogl_os_init(CmdLine *cmdln)
|
||||
r_ogl_lnx_state->context = eglCreateContext(r_ogl_lnx_state->display, 0, EGL_NO_CONTEXT, options);
|
||||
if(r_ogl_lnx_state->context == EGL_NO_CONTEXT)
|
||||
{
|
||||
os_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't create OpenGL context with EGL."));
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't create OpenGL context with EGL."));
|
||||
abort_self(1);
|
||||
}
|
||||
}
|
||||
@@ -79,9 +79,9 @@ r_ogl_os_init(CmdLine *cmdln)
|
||||
}
|
||||
|
||||
internal R_Handle
|
||||
r_ogl_os_window_equip(OS_Window window)
|
||||
r_ogl_os_window_equip(WM_Window window)
|
||||
{
|
||||
OS_LNX_Window *window_os = (OS_LNX_Window *)window.u64[0];
|
||||
LNX_WM_Window *window_os = (LNX_WM_Window *)window.u64[0];
|
||||
R_OGL_LNX_Window *w = r_ogl_lnx_state->free_window;
|
||||
if(w != 0)
|
||||
{
|
||||
@@ -120,7 +120,7 @@ r_ogl_os_window_equip(OS_Window window)
|
||||
};
|
||||
if(!eglChooseConfig(r_ogl_lnx_state->display, options, configs, ArrayCount(configs), &configs_count) || configs_count == 0)
|
||||
{
|
||||
os_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't choose EGL configuration."));
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't choose EGL configuration."));
|
||||
abort_self(1);
|
||||
}
|
||||
}
|
||||
@@ -143,7 +143,7 @@ r_ogl_os_window_equip(OS_Window window)
|
||||
}
|
||||
if(r_ogl_lnx_state->config == 0)
|
||||
{
|
||||
os_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't find a suitable EGL configuration."));
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't find a suitable EGL configuration."));
|
||||
abort_self(1);
|
||||
}
|
||||
}
|
||||
@@ -154,7 +154,7 @@ r_ogl_os_window_equip(OS_Window window)
|
||||
}
|
||||
if(w->surface == EGL_NO_SURFACE)
|
||||
{
|
||||
os_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't create EGL surface."));
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't create EGL surface."));
|
||||
abort_self(1);
|
||||
}
|
||||
}
|
||||
@@ -163,7 +163,7 @@ r_ogl_os_window_equip(OS_Window window)
|
||||
}
|
||||
|
||||
internal void
|
||||
r_ogl_os_window_unequip(OS_Window os, R_Handle r)
|
||||
r_ogl_os_window_unequip(WM_Window os, R_Handle r)
|
||||
{
|
||||
R_OGL_LNX_Window *w = (R_OGL_LNX_Window *)r.u64[0];
|
||||
{
|
||||
@@ -173,17 +173,17 @@ r_ogl_os_window_unequip(OS_Window os, R_Handle r)
|
||||
}
|
||||
|
||||
internal void
|
||||
r_ogl_os_select_window(OS_Window os, R_Handle r)
|
||||
r_ogl_os_select_window(WM_Window os, R_Handle r)
|
||||
{
|
||||
OS_LNX_Window *w = (OS_LNX_Window *)os.u64[0];
|
||||
LNX_WM_Window *w = (LNX_WM_Window *)os.u64[0];
|
||||
R_OGL_LNX_Window *w_r = (R_OGL_LNX_Window *)r.u64[0];
|
||||
eglMakeCurrent(r_ogl_lnx_state->display, w_r->surface, w_r->surface, r_ogl_lnx_state->context);
|
||||
}
|
||||
|
||||
internal void
|
||||
r_ogl_os_window_swap(OS_Window os, R_Handle r)
|
||||
r_ogl_os_window_swap(WM_Window os, R_Handle r)
|
||||
{
|
||||
OS_LNX_Window *w = (OS_LNX_Window *)os.u64[0];
|
||||
LNX_WM_Window *w = (LNX_WM_Window *)os.u64[0];
|
||||
R_OGL_LNX_Window *w_r = (R_OGL_LNX_Window *)r.u64[0];
|
||||
eglSwapBuffers(r_ogl_lnx_state->display, w_r->surface);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ r_ogl_os_init(CmdLine *cmdln)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
String8 message = push_str8f(scratch.arena, "Unsupported GLX version (%i.%i, need at least 1.3)", glx_version_major, glx_version_minor);
|
||||
os_graphical_message(1, str8_lit("Fatal Error"), message);
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), message);
|
||||
abort_self(1);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
@@ -45,7 +45,7 @@ r_ogl_os_init(CmdLine *cmdln)
|
||||
GLXFBConfig *framebuffer_configs = glXChooseFBConfig(os_lnx_gfx_state->display, DefaultScreen(os_lnx_gfx_state->display), framebuffer_config_options, &framebuffer_configs_count);
|
||||
if(framebuffer_configs == 0)
|
||||
{
|
||||
os_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Could not find a suitable framebuffer configuration."));
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Could not find a suitable framebuffer configuration."));
|
||||
abort_self(1);
|
||||
}
|
||||
GLXFBConfig framebuffer_config = framebuffer_configs[0];
|
||||
@@ -79,28 +79,28 @@ r_ogl_os_init(CmdLine *cmdln)
|
||||
}
|
||||
|
||||
internal R_Handle
|
||||
r_ogl_os_window_equip(OS_Window window)
|
||||
r_ogl_os_window_equip(WM_Window window)
|
||||
{
|
||||
R_Handle result = {0};
|
||||
return result;
|
||||
}
|
||||
|
||||
internal void
|
||||
r_ogl_os_window_unequip(OS_Window os, R_Handle r)
|
||||
r_ogl_os_window_unequip(WM_Window os, R_Handle r)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
internal void
|
||||
r_ogl_os_select_window(OS_Window os, R_Handle r)
|
||||
r_ogl_os_select_window(WM_Window os, R_Handle r)
|
||||
{
|
||||
OS_LNX_Window *w = (OS_LNX_Window *)os.u64[0];
|
||||
LNX_WM_Window *w = (LNX_WM_Window *)os.u64[0];
|
||||
glXMakeCurrent(os_lnx_gfx_state->display, w->window, r_ogl_lnx_ctx);
|
||||
}
|
||||
|
||||
internal void
|
||||
r_ogl_os_window_swap(OS_Window os, R_Handle r)
|
||||
r_ogl_os_window_swap(WM_Window os, R_Handle r)
|
||||
{
|
||||
OS_LNX_Window *w = (OS_LNX_Window *)os.u64[0];
|
||||
LNX_WM_Window *w = (LNX_WM_Window *)os.u64[0];
|
||||
glXSwapBuffers(os_lnx_gfx_state->display, w->window);
|
||||
}
|
||||
|
||||
@@ -201,14 +201,14 @@ r_init(CmdLine *cmdln)
|
||||
//- rjf: window setup/teardown
|
||||
|
||||
r_hook R_Handle
|
||||
r_window_equip(OS_Window window)
|
||||
r_window_equip(WM_Window window)
|
||||
{
|
||||
R_Handle result = r_ogl_os_window_equip(window);
|
||||
return result;
|
||||
}
|
||||
|
||||
r_hook void
|
||||
r_window_unequip(OS_Window window, R_Handle window_equip)
|
||||
r_window_unequip(WM_Window window, R_Handle window_equip)
|
||||
{
|
||||
r_ogl_os_window_unequip(window, window_equip);
|
||||
}
|
||||
@@ -341,12 +341,12 @@ r_end_frame(void)
|
||||
}
|
||||
|
||||
r_hook void
|
||||
r_window_begin_frame(OS_Window os, R_Handle r)
|
||||
r_window_begin_frame(WM_Window os, R_Handle r)
|
||||
{
|
||||
r_ogl_os_select_window(os, r);
|
||||
|
||||
//- rjf: unpack window viewport info
|
||||
Rng2F32 client_rect = os_client_rect_from_window(os);
|
||||
Rng2F32 client_rect = wm_client_rect_from_window(os);
|
||||
Vec2F32 client_rect_dim = dim_2f32(client_rect);
|
||||
|
||||
//- rjf: clear and reset state
|
||||
@@ -358,7 +358,7 @@ r_window_begin_frame(OS_Window os, R_Handle r)
|
||||
}
|
||||
|
||||
r_hook void
|
||||
r_window_end_frame(OS_Window os, R_Handle r)
|
||||
r_window_end_frame(WM_Window os, R_Handle r)
|
||||
{
|
||||
for(R_OGL_FlushBuffer *flush_buffer = r_ogl_state->first_buffer_to_flush; flush_buffer != 0; flush_buffer = flush_buffer->next)
|
||||
{
|
||||
@@ -372,9 +372,9 @@ r_window_end_frame(OS_Window os, R_Handle r)
|
||||
//- rjf: render pass submission
|
||||
|
||||
r_hook void
|
||||
r_window_submit(OS_Window window, R_Handle window_equip, R_PassList *passes)
|
||||
r_window_submit(WM_Window window, R_Handle window_equip, R_PassList *passes)
|
||||
{
|
||||
Rng2F32 viewport_rect = os_client_rect_from_window(window);
|
||||
Rng2F32 viewport_rect = wm_client_rect_from_window(window);
|
||||
Vec2F32 viewport_dim = dim_2f32(viewport_rect);
|
||||
for(R_PassNode *pass_n = passes->first; pass_n != 0; pass_n = pass_n->next)
|
||||
{
|
||||
|
||||
@@ -224,9 +224,9 @@ internal void r_ogl_debug_message_callback(GLenum source, GLenum type, GLuint id
|
||||
|
||||
internal VoidProc *r_ogl_os_load_procedure(char *name);
|
||||
internal void r_ogl_os_init(CmdLine *cmdln);
|
||||
internal R_Handle r_ogl_os_window_equip(OS_Window window);
|
||||
internal void r_ogl_os_window_unequip(OS_Window os, R_Handle r);
|
||||
internal void r_ogl_os_select_window(OS_Window os, R_Handle r);
|
||||
internal void r_ogl_os_window_swap(OS_Window os, R_Handle r);
|
||||
internal R_Handle r_ogl_os_window_equip(WM_Window window);
|
||||
internal void r_ogl_os_window_unequip(WM_Window os, R_Handle r);
|
||||
internal void r_ogl_os_select_window(WM_Window os, R_Handle r);
|
||||
internal void r_ogl_os_window_swap(WM_Window os, R_Handle r);
|
||||
|
||||
#endif // RENDER_OPENGL_H
|
||||
|
||||
@@ -101,10 +101,10 @@ r_ogl_os_init(CmdLine *cmdline)
|
||||
}
|
||||
|
||||
internal R_Handle
|
||||
r_ogl_os_window_equip(OS_Window window)
|
||||
r_ogl_os_window_equip(WM_Window window)
|
||||
{
|
||||
//- rjf: unpack window
|
||||
OS_W32_Window *w = os_w32_window_from_handle(window);
|
||||
W32_WM_Window *w = w32_wm_window_from_handle(window);
|
||||
HWND hwnd = w->hwnd;
|
||||
HDC hdc = w->hdc;
|
||||
|
||||
@@ -155,14 +155,14 @@ r_ogl_os_window_equip(OS_Window window)
|
||||
}
|
||||
|
||||
internal void
|
||||
r_ogl_os_window_unequip(OS_Window os, R_Handle r)
|
||||
r_ogl_os_window_unequip(WM_Window os, R_Handle r)
|
||||
{
|
||||
}
|
||||
|
||||
internal void
|
||||
r_ogl_os_select_window(OS_Window os, R_Handle r)
|
||||
r_ogl_os_select_window(WM_Window os, R_Handle r)
|
||||
{
|
||||
OS_W32_Window *w = os_w32_window_from_handle(os);
|
||||
W32_WM_Window *w = w32_wm_window_from_handle(os);
|
||||
if(w != 0)
|
||||
{
|
||||
HWND hwnd = w->hwnd;
|
||||
@@ -172,9 +172,9 @@ r_ogl_os_select_window(OS_Window os, R_Handle r)
|
||||
}
|
||||
|
||||
internal void
|
||||
r_ogl_os_window_swap(OS_Window os, R_Handle r)
|
||||
r_ogl_os_window_swap(WM_Window os, R_Handle r)
|
||||
{
|
||||
OS_W32_Window *w = os_w32_window_from_handle(os);
|
||||
W32_WM_Window *w = w32_wm_window_from_handle(os);
|
||||
if(w != 0)
|
||||
{
|
||||
HDC dc = w->hdc;
|
||||
|
||||
@@ -281,8 +281,8 @@ internal R_Pass *r_pass_from_kind(Arena *arena, R_PassList *list, R_PassKind kin
|
||||
r_hook void r_init(CmdLine *cmdln);
|
||||
|
||||
//- rjf: window setup/teardown
|
||||
r_hook R_Handle r_window_equip(OS_Window window);
|
||||
r_hook void r_window_unequip(OS_Window window, R_Handle window_equip);
|
||||
r_hook R_Handle r_window_equip(WM_Window window);
|
||||
r_hook void r_window_unequip(WM_Window window, R_Handle window_equip);
|
||||
|
||||
//- rjf: textures
|
||||
r_hook R_Handle r_tex2d_alloc(R_ResourceKind kind, Vec2S32 size, R_Tex2DFormat format, void *data);
|
||||
@@ -299,10 +299,10 @@ r_hook void r_buffer_release(R_Handle buffer);
|
||||
//- rjf: frame markers
|
||||
r_hook void r_begin_frame(void);
|
||||
r_hook void r_end_frame(void);
|
||||
r_hook void r_window_begin_frame(OS_Window window, R_Handle window_equip);
|
||||
r_hook void r_window_end_frame(OS_Window window, R_Handle window_equip);
|
||||
r_hook void r_window_begin_frame(WM_Window window, R_Handle window_equip);
|
||||
r_hook void r_window_end_frame(WM_Window window, R_Handle window_equip);
|
||||
|
||||
//- rjf: render pass submission
|
||||
r_hook void r_window_submit(OS_Window window, R_Handle window_equip, R_PassList *passes);
|
||||
r_hook void r_window_submit(WM_Window window, R_Handle window_equip, R_PassList *passes);
|
||||
|
||||
#endif // RENDER_CORE_H
|
||||
|
||||
Reference in New Issue
Block a user