mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-14 17:28:07 +00:00
os/gfx/linux: create x11 window with gl-chosen visual / colormap
This commit is contained in:
committed by
Ryan Fleury
parent
562c2e3e5f
commit
2e5a97ebf9
@@ -121,15 +121,32 @@ wm_window_open(Rng2F32 rect, WM_WindowFlags flags, String8 title)
|
|||||||
DLLPushBack(lnx_wm_state->first_window, lnx_wm_state->last_window, w);
|
DLLPushBack(lnx_wm_state->first_window, lnx_wm_state->last_window, w);
|
||||||
|
|
||||||
//- rjf: create window & equip with x11 info
|
//- rjf: create window & equip with x11 info
|
||||||
|
Visual *visual = lnx_wm_state->window_visual;
|
||||||
|
int depth = lnx_wm_state->window_depth;
|
||||||
|
Colormap colormap = lnx_wm_state->window_colormap;
|
||||||
|
unsigned long attr_mask = 0;
|
||||||
|
XSetWindowAttributes window_attribs = {0};
|
||||||
|
if(visual == 0)
|
||||||
|
{
|
||||||
|
visual = (Visual *)CopyFromParent;
|
||||||
|
depth = CopyFromParent;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
window_attribs.background_pixmap = None;
|
||||||
|
window_attribs.border_pixel = 0;
|
||||||
|
window_attribs.colormap = colormap;
|
||||||
|
attr_mask = CWBackPixmap|CWBorderPixel|CWColormap;
|
||||||
|
}
|
||||||
w->window = XCreateWindow(lnx_wm_state->display,
|
w->window = XCreateWindow(lnx_wm_state->display,
|
||||||
XDefaultRootWindow(lnx_wm_state->display),
|
XDefaultRootWindow(lnx_wm_state->display),
|
||||||
0, 0, resolution.x, resolution.y,
|
0, 0, resolution.x, resolution.y,
|
||||||
0,
|
0,
|
||||||
CopyFromParent,
|
depth,
|
||||||
InputOutput,
|
InputOutput,
|
||||||
CopyFromParent,
|
visual,
|
||||||
0,
|
attr_mask,
|
||||||
0);
|
&window_attribs);
|
||||||
XSelectInput(lnx_wm_state->display, w->window,
|
XSelectInput(lnx_wm_state->display, w->window,
|
||||||
ExposureMask|
|
ExposureMask|
|
||||||
PointerMotionMask|
|
PointerMotionMask|
|
||||||
@@ -194,6 +211,7 @@ wm_window_first_paint(WM_Window handle)
|
|||||||
if(wm_window_match(handle, wm_window_zero())) {return;}
|
if(wm_window_match(handle, wm_window_zero())) {return;}
|
||||||
LNX_WM_Window *w = (LNX_WM_Window *)handle.u64[0];
|
LNX_WM_Window *w = (LNX_WM_Window *)handle.u64[0];
|
||||||
XMapWindow(lnx_wm_state->display, w->window);
|
XMapWindow(lnx_wm_state->display, w->window);
|
||||||
|
XFlush(lnx_wm_state->display);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void
|
internal void
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ struct LNX_WM_State
|
|||||||
WM_Cursor last_set_cursor;
|
WM_Cursor last_set_cursor;
|
||||||
WM_SystemInfo gfx_info;
|
WM_SystemInfo gfx_info;
|
||||||
int wakeup_fd;
|
int wakeup_fd;
|
||||||
|
Visual *window_visual;
|
||||||
|
int window_depth;
|
||||||
|
Colormap window_colormap;
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user