valhalla_window 0.0.1-alpha
A GLFW wrapper for GLFWwindow in D
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
Valhala Window - (VWindow)
A simple GLFW3 GLFWwindow wrapper abstraction.
What's different
VWindow encapsulates GLFWwindow's instance in a class Window. All GLFW's functions are easily accessible with it's instance making the programm less verbose and easier to write. The main window events are also available and working with delegates.
Example
glfwInit();
scope(exit) glfwTerminate();
// creates a default window
// width: 1280
// height: 720
// title: "Valhala"
auto win = new Window();
// events are easy to set
win.cursorPosCallback = (Window, double x, double y) => writefln!"Cursor moved at %s,%s"(x,y);
win.posCallback = (Window,int,int) {};
// to remove an event
win.posCallback = null;
win.swapInterval = 1;
// main loop
while (!win.shouldClose)
{
glfwPoolEvents();
win.swapBuffers();
}
glfwInit();
scope(exit) glfwTerminate();
// creates a windowed window and doesn't make it's context current
auto win = new Window(ivec(1280,720), "title", No.fullscreen, No.makeCurrent)
win.swapInterval = 1;
// main loop
while (!win.shouldClose)
{
glfwPoolEvents();
win.swapBuffers();
}
Libraries used
License
Licensed under: MIT
Contribution
If you are interested in project and want to improve it, creating issues and pull requests are highly appretiated!
- Registered by João Lourenço
- 0.0.1-alpha released 3 years ago
- ValhallaLib/valhalla_window
- MIT
- Copyright (C) 2021 ValhalaLib
- Dependencies:
- bindbc-glfw
- Versions:
-
0.0.2-alpha 2021-Mar-11 0.0.1-alpha 2021-Feb-24 ~master 2021-Mar-11 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
12 downloads total
-
- Score:
- 0.3
- Short URL:
- valhalla_window.dub.pm