src/video/haiku/SDL_bvideo.cc
changeset 12201 8bdc4d340419
parent 12082 09999a0e8f9a
child 12503 806492103856
equal deleted inserted replaced
12200:c0b17b32b95e 12201:8bdc4d340419
    54 
    54 
    55     /* Initialize all variables that we clean on shutdown */
    55     /* Initialize all variables that we clean on shutdown */
    56     device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
    56     device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
    57 
    57 
    58     device->driverdata = NULL; /* FIXME: Is this the cause of some of the
    58     device->driverdata = NULL; /* FIXME: Is this the cause of some of the
    59     							  SDL_Quit() errors? */
    59                                   SDL_Quit() errors? */
    60 
    60 
    61 /* TODO: Figure out if any initialization needs to go here */
    61 /* TODO: Figure out if any initialization needs to go here */
    62 
    62 
    63     /* Set the function pointers */
    63     /* Set the function pointers */
    64     device->VideoInit = HAIKU_VideoInit;
    64     device->VideoInit = HAIKU_VideoInit;
   120 
   120 
   121     return device;
   121     return device;
   122 }
   122 }
   123 
   123 
   124 VideoBootStrap HAIKU_bootstrap = {
   124 VideoBootStrap HAIKU_bootstrap = {
   125 	"haiku", "Haiku graphics",
   125     "haiku", "Haiku graphics",
   126 	HAIKU_Available, HAIKU_CreateDevice
   126     HAIKU_Available, HAIKU_CreateDevice
   127 };
   127 };
   128 
   128 
   129 void HAIKU_DeleteDevice(SDL_VideoDevice * device)
   129 void HAIKU_DeleteDevice(SDL_VideoDevice * device)
   130 {
   130 {
   131 	SDL_free(device->driverdata);
   131     SDL_free(device->driverdata);
   132 	SDL_free(device);
   132     SDL_free(device);
   133 }
   133 }
   134 
   134 
   135 int HAIKU_VideoInit(_THIS)
   135 int HAIKU_VideoInit(_THIS)
   136 {
   136 {
   137 	/* Initialize the Be Application for appserver interaction */
   137     /* Initialize the Be Application for appserver interaction */
   138 	if (SDL_InitBeApp() < 0) {
   138     if (SDL_InitBeApp() < 0) {
   139 		return -1;
   139         return -1;
   140 	}
   140     }
   141 	
   141     
   142 	/* Initialize video modes */
   142     /* Initialize video modes */
   143 	HAIKU_InitModes(_this);
   143     HAIKU_InitModes(_this);
   144 
   144 
   145 	/* Init the keymap */
   145     /* Init the keymap */
   146 	HAIKU_InitOSKeymap();
   146     HAIKU_InitOSKeymap();
   147 	
   147 
   148 	
       
   149 #if SDL_VIDEO_OPENGL
   148 #if SDL_VIDEO_OPENGL
   150         /* testgl application doesn't load library, just tries to load symbols */
   149         /* testgl application doesn't load library, just tries to load symbols */
   151         /* is it correct? if so we have to load library here */
   150         /* is it correct? if so we have to load library here */
   152     HAIKU_GL_LoadLibrary(_this, NULL);
   151     HAIKU_GL_LoadLibrary(_this, NULL);
   153 #endif
   152 #endif
   154 
   153 
   155         /* We're done! */
   154     /* We're done! */
   156     return (0);
   155     return (0);
   157 }
   156 }
   158 
   157 
   159 int HAIKU_Available(void)
   158 int HAIKU_Available(void)
   160 {
   159 {