aboutsummaryrefslogtreecommitdiffhomepage
path: root/xcode/sampleapp_sdl
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-05-26 13:27:48 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-05-26 13:27:48 +0000
commitc3a8c5fb385dca5c57f8002e5331360f21c1a61f (patch)
treea462be18d53ccada7dc9ca0036c793c20f8d0558 /xcode/sampleapp_sdl
parent437f35e5ec24467ba302e0e8113f882a76a690ee (diff)
create offscreen surface so we can set its RGB ordering to match our internals
git-svn-id: http://skia.googlecode.com/svn/trunk@187 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'xcode/sampleapp_sdl')
-rw-r--r--xcode/sampleapp_sdl/skia_sdl_main.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/xcode/sampleapp_sdl/skia_sdl_main.cpp b/xcode/sampleapp_sdl/skia_sdl_main.cpp
index e54d34046d..1e42c2d39b 100644
--- a/xcode/sampleapp_sdl/skia_sdl_main.cpp
+++ b/xcode/sampleapp_sdl/skia_sdl_main.cpp
@@ -15,10 +15,13 @@
#include "SkApplication.h"
#include "SkWindow.h"
+#define WINDOW_WIDTH 800
+#define WINDOW_HEIGHT 600
+
int main(int argc, char *argv[]) {
Uint32 initflags = SDL_INIT_VIDEO | SDL_INIT_TIMER;
SDL_Surface *screen;
- Uint8 video_bpp = 0;
+ Uint8 video_bpp = 32;
Uint32 videoflags = SDL_SWSURFACE;
SDL_Event event;
@@ -30,14 +33,13 @@ int main(int argc, char *argv[]) {
}
/* Set 640x480 video mode */
- screen=SDL_SetVideoMode(640,480, video_bpp, videoflags);
- if (screen == NULL) {
- fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n",
- video_bpp, SDL_GetError());
+ screen=SDL_SetVideoMode(WINDOW_WIDTH, WINDOW_HEIGHT, video_bpp, videoflags);
+ if (screen == NULL) {
+ fprintf(stderr, "Couldn't set video mode: %s\n", SDL_GetError());
SDL_Quit();
exit(2);
}
-
+
application_init();
SkOSWindow* skwin = create_sk_window(screen);