diff options
author | Keith Whitwell <[email protected]> | 2010-05-14 12:12:54 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2010-05-14 12:19:57 +0100 |
commit | 15321a55e541c3209be6636ea467695a0bc6d55d (patch) | |
tree | 5fc82a59cd84668daa09861549e73145dfcdb54b /src/gallium/tests | |
parent | c26751447011a713924b9163a1e0b44fd39c6b1c (diff) |
graw: combine graw_init and graw_create_window functions
Different environments seem to want to create these in different
orders. Abstract over this by combining the calls.
Diffstat (limited to 'src/gallium/tests')
-rw-r--r-- | src/gallium/tests/graw/clear.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/gallium/tests/graw/clear.c b/src/gallium/tests/graw/clear.c index adcbb08308f..28c986eee64 100644 --- a/src/gallium/tests/graw/clear.c +++ b/src/gallium/tests/graw/clear.c @@ -53,13 +53,20 @@ static void init( void ) struct pipe_resource *tex, templat; int i; + /* It's hard to say whether window or screen should be created + * first. Different environments would prefer one or the other. + * + * Also, no easy way of querying supported formats if the screen + * cannot be created first. + */ for (i = 0; window == NULL && formats[i] != PIPE_FORMAT_NONE; i++) { - window = graw_create_window(0,0,300,300, formats[i]); + screen = graw_create_window_and_screen(0,0,300,300, + formats[i], + &window); } - if (window == NULL) exit(2); @@ -98,15 +105,11 @@ static void init( void ) } + int main( int argc, char *argv[] ) { - screen = graw_init(); - if (screen == NULL) - exit(1); - init(); - graw_set_display_func( draw ); graw_main_loop(); return 0; |