loki: added color gradiant
This commit is contained in:
		
							
								
								
									
										32
									
								
								loki_sample/init_sdl_example/initializing-sdl.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								loki_sample/init_sdl_example/initializing-sdl.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | ||||
| /* Example of initializing SDL. */ | ||||
|  | ||||
| #include <SDL/SDL.h> | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
|  | ||||
| int main() | ||||
| { | ||||
| 	SDL_Surface *screen; | ||||
|  | ||||
| 	/* Initialize SDL's video system and check for errors */ | ||||
| 	if (SDL_Init(SDL_INIT_VIDEO) != 0) { | ||||
| 		printf("Unable to initialize SDL: %s\n", SDL_GetError()); | ||||
| 		return 1; | ||||
| 	} | ||||
|  | ||||
| 	/* Make sure SDL_Quit gets called when the program exits! */ | ||||
| 	atexit(SDL_Quit); | ||||
|  | ||||
| 	/* Attempt to set a 650x480 hicolor video mode */ // I uped it a bit cuz fuck that. | ||||
| 	screen = SDL_SetVideoMode(1024, 768, 32, SDL_FULLSCREEN); | ||||
| 	if (screen == NULL) { | ||||
| 		printf("Unable to set video mode: %s\n", SDL_GetError()); | ||||
| 		return 1; | ||||
| 	} | ||||
|  | ||||
| 	/* If we got this far, everything worked */ | ||||
| 	printf("Success!\n"); | ||||
|  | ||||
| 	return 0; | ||||
|  | ||||
| } | ||||
		Reference in New Issue
	
	Block a user