Mercurial > mxe-octave
annotate src/sdl_image-test.c @ 2333:f653602a0500
Rebrand to new project name MXE
author | Volker Grabsch <vog@notjusthosting.com> |
---|---|
date | Wed, 28 Mar 2012 15:46:58 +0200 |
parents | 870ce42b74d3 |
children | 8a6c466753e2 |
rev | line source |
---|---|
2333
f653602a0500
Rebrand to new project name MXE
Volker Grabsch <vog@notjusthosting.com>
parents:
1632
diff
changeset
|
1 /* This file is part of MXE. */ |
733
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
2 /* See doc/index.html for further information. */ |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
3 |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
4 #include <SDL.h> |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
5 #include <SDL_image.h> |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
6 |
946
35a9e556c82c
improved coding style of test programs
Volker Grabsch <vog@notjusthosting.com>
parents:
733
diff
changeset
|
7 int main(int argc, char *argv[]) |
733
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
8 { |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
9 SDL_Surface *image; |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
10 SDL_Surface *screen; |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
11 |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
12 (void)argc; |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
13 (void)argv; |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
14 |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
15 if (SDL_Init(SDL_INIT_EVERYTHING) < 0) return 1; |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
16 |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
17 image = IMG_Load("test.png"); |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
18 screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE); |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
19 |
1632
870ce42b74d3
package sdl_image: show image on screen in test program
Tony Theodore <tonyt@logyst.com>
parents:
946
diff
changeset
|
20 if (SDL_BlitSurface(image, NULL, screen, NULL) < 0) return 1; |
870ce42b74d3
package sdl_image: show image on screen in test program
Tony Theodore <tonyt@logyst.com>
parents:
946
diff
changeset
|
21 SDL_UpdateRect(screen, 0, 0, image->w, image->h); |
870ce42b74d3
package sdl_image: show image on screen in test program
Tony Theodore <tonyt@logyst.com>
parents:
946
diff
changeset
|
22 SDL_Delay(3000); |
733
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
23 SDL_Quit(); |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
24 return 0; |
6f7cdcfc3279
bugfix and test program for package sdl_image
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
25 } |