mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-11-18 04:00:12 -08:00
split shell operation abstraction from graphical window manager abstraction - do basic integration of common linux utilities for implementing shell operations - also add 'sh_install_or_uninstall_self' for doing shell-specific operations related to installing or uninstalling an application. hook up to config state in raddbg
This commit is contained in:
1 parent
32ef9095e0
commit
867b64f7a2
26 files changed
+551
-201
No files matched your search
@@ -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);
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_cstring(buffer));
|
||||
sh_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));
|
||||
wm_graphical_message(1, str8_lit("Vertex Shader Compilation Failure"), errors);
|
||||
sh_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));
|
||||
wm_graphical_message(1, str8_lit("Pixel Shader Compilation Failure"), errors);
|
||||
sh_message(1, str8_lit("Pixel Shader Compilation Failure"), errors);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -534,7 +534,7 @@ r_window_equip(WM_Window handle)
|
||||
{
|
||||
char buffer[256] = {0};
|
||||
raddbg_snprintf(buffer, sizeof(buffer), "DXGI swap chain creation failure (%lx). The process is terminating.", error);
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_cstring(buffer));
|
||||
sh_message(1, str8_lit("Fatal Error"), str8_cstring(buffer));
|
||||
abort_self(1);
|
||||
}
|
||||
|
||||
@@ -1052,7 +1052,7 @@ r_window_end_frame(WM_Window window, R_Handle window_equip)
|
||||
{
|
||||
char buffer[256] = {0};
|
||||
raddbg_snprintf(buffer, sizeof(buffer), "D3D11 present failure (%lx). The process is terminating.", error);
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_cstring(buffer));
|
||||
sh_message(1, str8_lit("Fatal Error"), str8_cstring(buffer));
|
||||
abort_self(1);
|
||||
}
|
||||
d_ctx->lpVtbl->ClearState(d_ctx);
|
||||
|
||||
@@ -23,7 +23,7 @@ r_ogl_os_init(CmdLine *cmdln)
|
||||
r_ogl_lnx_state->display = eglGetDisplay((EGLNativeDisplayType)lnx_wm_state->display);
|
||||
if(r_ogl_lnx_state->display == EGL_NO_DISPLAY)
|
||||
{
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Failed to get EGL display."));
|
||||
sh_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))
|
||||
{
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't initialize EGL display."));
|
||||
sh_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);
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), message);
|
||||
sh_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))
|
||||
{
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't initialize EGL API to OpenGL."));
|
||||
sh_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't initialize EGL API to OpenGL."));
|
||||
abort_self(1);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ r_ogl_os_init(CmdLine *cmdln)
|
||||
EGLint configs_count = 0;
|
||||
if(!eglChooseConfig(r_ogl_lnx_state->display, config_filter, configs, ArrayCount(configs), &configs_count) || configs_count == 0)
|
||||
{
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't choose EGL configuration."));
|
||||
sh_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't choose EGL configuration."));
|
||||
abort_self(1);
|
||||
}
|
||||
int screen = DefaultScreen(lnx_wm_state->display);
|
||||
@@ -97,7 +97,7 @@ r_ogl_os_init(CmdLine *cmdln)
|
||||
}
|
||||
if(vi == 0 || r_ogl_lnx_state->config == 0)
|
||||
{
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't find an EGL config with a matching X11 visual."));
|
||||
sh_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't find an EGL config with a matching X11 visual."));
|
||||
abort_self(1);
|
||||
}
|
||||
lnx_wm_state->window_visual = vi->visual;
|
||||
@@ -125,7 +125,7 @@ r_ogl_os_init(CmdLine *cmdln)
|
||||
r_ogl_lnx_state->context = eglCreateContext(r_ogl_lnx_state->display, r_ogl_lnx_state->config, EGL_NO_CONTEXT, options);
|
||||
if(r_ogl_lnx_state->context == EGL_NO_CONTEXT)
|
||||
{
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't create OpenGL context with EGL."));
|
||||
sh_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't create OpenGL context with EGL."));
|
||||
abort_self(1);
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ r_ogl_os_window_equip(WM_Window window)
|
||||
}
|
||||
if(w->surface == EGL_NO_SURFACE)
|
||||
{
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't create EGL surface."));
|
||||
sh_message(1, str8_lit("Fatal Error"), str8_lit("Couldn't create EGL surface."));
|
||||
abort_self(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), message);
|
||||
sh_message(1, str8_lit("Fatal Error"), message);
|
||||
abort_self(1);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
@@ -45,25 +45,25 @@ r_ogl_os_init(CmdLine *cmdln)
|
||||
GLXFBConfig *framebuffer_configs = glXChooseFBConfig(lnx_wm_state->display, DefaultScreen(lnx_wm_state->display), framebuffer_config_options, &framebuffer_configs_count);
|
||||
if(framebuffer_configs == 0)
|
||||
{
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Could not find a suitable framebuffer configuration."));
|
||||
sh_message(1, str8_lit("Fatal Error"), str8_lit("Could not find a suitable framebuffer configuration."));
|
||||
abort_self(1);
|
||||
}
|
||||
GLXFBConfig framebuffer_config = framebuffer_configs[0];
|
||||
XFree(framebuffer_configs);
|
||||
|
||||
|
||||
//- extract visual/colormap from chosen fbconfig, publish to os layer
|
||||
{
|
||||
XVisualInfo *vi = glXGetVisualFromFBConfig(lnx_wm_state->display, framebuffer_config);
|
||||
if(vi == 0)
|
||||
{
|
||||
wm_graphical_message(1, str8_lit("Fatal Error"), str8_lit("Could not get visual from GLX framebuffer config."));
|
||||
sh_message(1, str8_lit("Fatal Error"), str8_lit("Could not get visual from GLX framebuffer config."));
|
||||
abort_self(1);
|
||||
}
|
||||
lnx_wm_state->window_visual = vi->visual;
|
||||
lnx_wm_state->window_depth = vi->depth;
|
||||
lnx_wm_state->window_colormap = XCreateColormap(lnx_wm_state->display,
|
||||
XRootWindow(lnx_wm_state->display, vi->screen),
|
||||
vi->visual, AllocNone);
|
||||
XRootWindow(lnx_wm_state->display, vi->screen),
|
||||
vi->visual, AllocNone);
|
||||
XFree(vi);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user