use and initialize DerelictGL{,U}
This commit is contained in:
parent
491d6778ad
commit
4dc0103df3
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
TARGET := sdl_opengl_bare
|
TARGET := sdl_opengl_bare
|
||||||
DFLAGS := -I/usr/local/include/d -g
|
DFLAGS := -I/usr/local/include/d -g
|
||||||
LDFLAGS := -lDerelictSDL -lDerelictUtil -ldl
|
LDFLAGS := -lDerelictSDL -lDerelictGL -lDerelictGLU -lDerelictUtil -ldl -lGL -lGLU
|
||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
|
|
||||||
|
@ -1,12 +1,29 @@
|
|||||||
import std.stdio;
|
import std.stdio;
|
||||||
import derelict.sdl.sdl;
|
import derelict.sdl.sdl;
|
||||||
|
import derelict.opengl.gl;
|
||||||
|
import derelict.opengl.glu;
|
||||||
|
|
||||||
enum int WIDTH = 800;
|
enum int WIDTH = 800;
|
||||||
enum int HEIGHT = 600;
|
enum int HEIGHT = 600;
|
||||||
|
|
||||||
|
void init()
|
||||||
|
{
|
||||||
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
|
glShadeModel(GL_SMOOTH);
|
||||||
|
glViewport(0, 0, WIDTH, HEIGHT);
|
||||||
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
glLoadIdentity();
|
||||||
|
gluPerspective(60.0, cast(GLfloat)WIDTH/cast(GLfloat)WIDTH, 1.0, 30.0);
|
||||||
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
glLoadIdentity();
|
||||||
|
glTranslatef(0.0, 0.0, -10.0);
|
||||||
|
}
|
||||||
|
|
||||||
int main(char[][] args)
|
int main(char[][] args)
|
||||||
{
|
{
|
||||||
DerelictSDL.load();
|
DerelictSDL.load();
|
||||||
|
DerelictGL.load();
|
||||||
|
DerelictGLU.load();
|
||||||
|
|
||||||
if (SDL_Init(SDL_INIT_EVERYTHING))
|
if (SDL_Init(SDL_INIT_EVERYTHING))
|
||||||
{
|
{
|
||||||
@ -24,6 +41,7 @@ int main(char[][] args)
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init();
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
while (SDL_WaitEvent(&event))
|
while (SDL_WaitEvent(&event))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user