forked from KolibriOS/kolibrios
Gallium 3D: kos_winsys
git-svn-id: svn://kolibrios.org@3773 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
985e4f70b5
commit
09ee9d676a
@ -72,14 +72,21 @@ graw_create_window_and_screen(int x,
|
|||||||
if (format != PIPE_FORMAT_B8G8R8X8_UNORM)
|
if (format != PIPE_FORMAT_B8G8R8X8_UNORM)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
winsys = kos_create_sw_winsys();
|
winsys = kos_create_sw_winsys();
|
||||||
if (winsys == NULL)
|
if (winsys == NULL)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
screen = sw_screen_create(winsys);
|
screen = sw_screen_create(winsys);
|
||||||
|
|
||||||
if (screen == NULL)
|
if (screen == NULL)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
BeginDraw();
|
||||||
|
DrawWindow(x, y,width-1,height-1,
|
||||||
|
NULL,0,0x41);
|
||||||
|
EndDraw();
|
||||||
|
|
||||||
|
*handle = (void *)winsys;
|
||||||
return (screen);
|
return (screen);
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
@ -99,12 +106,44 @@ graw_set_display_func(void (* draw)(void))
|
|||||||
void
|
void
|
||||||
graw_main_loop(void)
|
graw_main_loop(void)
|
||||||
{
|
{
|
||||||
for (;;) {
|
int ev;
|
||||||
|
oskey_t key;
|
||||||
if (graw.draw) {
|
|
||||||
graw.draw();
|
BeginDraw();
|
||||||
}
|
DrawWindow(0,0,0,0, NULL, 0x000000,0x41);
|
||||||
|
EndDraw();
|
||||||
delay(1);
|
|
||||||
}
|
if (graw.draw)
|
||||||
|
{
|
||||||
|
graw.draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
ev = wait_for_event(100);
|
||||||
|
|
||||||
|
switch(ev)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
BeginDraw();
|
||||||
|
DrawWindow(0,0,0,0, NULL, 0x000000,0x41);
|
||||||
|
EndDraw();
|
||||||
|
|
||||||
|
if (graw.draw)
|
||||||
|
{
|
||||||
|
graw.draw();
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
key = get_key();
|
||||||
|
// printf("key %x\n", key.code);
|
||||||
|
if( key.code == 0x1b)
|
||||||
|
return;
|
||||||
|
continue;
|
||||||
|
|
||||||
|
default:
|
||||||
|
continue;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
#include "util/u_memory.h"
|
#include "util/u_memory.h"
|
||||||
#include "state_tracker/graw.h"
|
#include "state_tracker/graw.h"
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* Helper functions. These are the same for all graw implementations.
|
/* Helper functions. These are the same for all graw implementations.
|
||||||
*/
|
*/
|
||||||
PUBLIC void *
|
PUBLIC void *
|
||||||
@ -55,7 +54,6 @@ graw_parse_fragment_shader(struct pipe_context *pipe,
|
|||||||
state.tokens = tokens;
|
state.tokens = tokens;
|
||||||
return pipe->create_fs_state(pipe, &state);
|
return pipe->create_fs_state(pipe, &state);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static char out_filename[256] = "";
|
static char out_filename[256] = "";
|
||||||
|
|
||||||
|
@ -182,11 +182,27 @@ kos_sw_display( struct sw_winsys *winsys,
|
|||||||
struct sw_displaytarget *dt)
|
struct sw_displaytarget *dt)
|
||||||
{
|
{
|
||||||
struct kos_sw_displaytarget *gdt = kos_sw_displaytarget(dt);
|
struct kos_sw_displaytarget *gdt = kos_sw_displaytarget(dt);
|
||||||
|
|
||||||
|
struct blit_call bc;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
bc.dstx = 0;
|
||||||
|
bc.dsty = 24;
|
||||||
|
bc.w = gdt->width;
|
||||||
|
bc.h = gdt->height;
|
||||||
|
bc.srcx = 0;
|
||||||
|
bc.srcy = 0;
|
||||||
|
bc.srcw = gdt->width;
|
||||||
|
bc.srch = gdt->height;
|
||||||
|
bc.stride = gdt->stride;
|
||||||
|
bc.bitmap = gdt->data;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"int $0x40":"=a"(ret):"a"(73), "b"(0x00),
|
||||||
|
"c"(&bc):"memory");
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
|
||||||
// StretchDIBits(hDC,
|
|
||||||
// 0, 0, gdt->width, gdt->height,
|
|
||||||
// 0, 0, gdt->width, gdt->height,
|
|
||||||
// gdt->data, &gdt->bmi, 0, SRCCOPY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user