updated win32 demo
This commit is contained in:
parent
c211b8f6e6
commit
bb8c8a61da
|
@ -97,11 +97,11 @@ font_new(HDC hdc, const char *name, int height)
|
|||
}
|
||||
|
||||
gui_size
|
||||
font_get_text_width(void *handle, const gui_char *text, gui_size len)
|
||||
font_get_text_width(gui_handle handle, const gui_char *text, gui_size len)
|
||||
{
|
||||
SIZE size;
|
||||
HFONT old;
|
||||
XWindow *win = handle;
|
||||
XWindow *win = handle.ptr;
|
||||
XFont *font = win->font;
|
||||
XSurface *surf = win->backbuffer;
|
||||
if (!font ||!text || !len) return 0;
|
||||
|
@ -300,7 +300,7 @@ execute(XSurface *surf, gui_command_buffer *buffer)
|
|||
case GUI_COMMAND_TEXT: {
|
||||
const struct gui_command_text *t = gui_command(text, cmd);
|
||||
XWindow *win = t->font;
|
||||
surface_draw_text(surf, win->font, t->x, t->y, t->w, t->h, (const char*)t->string,
|
||||
surface_draw_text(surf, win->font.ptr, t->x, t->y, t->w, t->h, (const char*)t->string,
|
||||
t->length, t->bg.r, t->bg.g, t->bg.b, t->fg.r, t->fg.g, t->fg.b);
|
||||
} break;
|
||||
case GUI_COMMAND_IMAGE:
|
||||
|
@ -416,7 +416,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR lpCmdLine, int shown)
|
|||
/* GUI */
|
||||
memset(&in, 0, sizeof in);
|
||||
memset(&gui, 0, sizeof gui);
|
||||
font.userdata = &xw;
|
||||
font.userdata.ptr = &xw;
|
||||
font.height = (gui_float)xw.font->height;
|
||||
font.width = font_get_text_width;
|
||||
gui.running = gui_true;
|
||||
|
|
Loading…
Reference in New Issue