29 lines
523 B
D
29 lines
523 B
D
import std.stdio;
|
|
import derelict.sdl.sdl;
|
|
|
|
enum int WIDTH = 800;
|
|
enum int HEIGHT = 600;
|
|
|
|
int main(char[][] args)
|
|
{
|
|
DerelictSDL.load();
|
|
|
|
if (SDL_Init(SDL_INIT_EVERYTHING))
|
|
{
|
|
writefln("Failed to initialize SDL!");
|
|
return 1;
|
|
}
|
|
|
|
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
|
|
|
SDL_Surface *screen;
|
|
if ((screen = SDL_SetVideoMode(WIDTH, HEIGHT, 32, SDL_OPENGL)) == null)
|
|
{
|
|
printf("Failed to set video mode!\n");
|
|
SDL_Quit();
|
|
return 2;
|
|
}
|
|
|
|
return 0;
|
|
}
|