Last change
on this file since 5220 was
5220,
checked in by jack, 16 years ago
|
anugavis: Started work on simple height quantities.
|
File size:
822 bytes
|
Line | |
---|
1 | #include <SDL.h> |
---|
2 | #include "anugavis.h" |
---|
3 | #include "error.h" |
---|
4 | #include "globals.h" |
---|
5 | |
---|
6 | int AnugaVis_Init(int width, int height, const char *swwFilePath){ |
---|
7 | if((SDL_Init(SDL_INIT_VIDEO) == -1) || |
---|
8 | (SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5) == -1) || |
---|
9 | (SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5) == -1) || |
---|
10 | (SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5) == -1) || |
---|
11 | (SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16) == -1) || |
---|
12 | (SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1) == -1) || |
---|
13 | ((anugavis.screen = |
---|
14 | SDL_SetVideoMode(width, height, 16, SDL_OPENGL)) == NULL)){ |
---|
15 | AnugaVis_SDLError(); |
---|
16 | return -1; |
---|
17 | } |
---|
18 | anugavis.heights = NULL; |
---|
19 | return 0; |
---|
20 | } |
---|
21 | |
---|
22 | void AnugaVis_DeInit(void){ |
---|
23 | while(anugavis.heights != NULL) |
---|
24 | AnugaVis_UndefineHeightQuantity(anugavis.heights->name); |
---|
25 | SDL_Quit(); |
---|
26 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.