Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import gtk.Main;
- import gdk.GLContext;
- import gtk.GLArea;
- import gtk.MainWindow;
- import gtk.Widget;
- import derelict.opengl3.gl3;
- class MyArea : GLArea {
- bool render (GLContext c, GLArea a)
- {
- makeCurrent();
- glClearColor(1,0,0,1);
- glClear(GL_COLOR_BUFFER_BIT);
- return true;
- }
- }
- class ExampleWindow : MainWindow
- {
- this()
- {
- super("GtkD: Try");
- MyArea glarea = new MyArea();
- glarea.addOnRender(&glarea.render);
- add(glarea);
- showAll();
- }
- }
- void main(string[] arg)
- {
- DerelictGL3.load();
- Main.init(arg);
- new ExampleWindow();
- Main.run();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement