DerelictGL3.reload with specified path question.
WhatMeWorry via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Aug 17 15:59:31 PDT 2016
I want to store all my shared/dynamic libraries within a special
directory relative to where the application directory is. All of
the derelictXX.loads(path) compiles except
DerelictGL3.reload(lib); which doesn't seem to be implemented.
All the reloads in github are either empty or use the version
specification which I don't believe accomplishes what I want to
achieve here.
Is there a different approach or some workaround? Thanks in
advance.
import derelict.glfw3.glfw3; // windowing (1)
import derelict.opengl3.gl3; // graphics (2a) (2b)
import derelict.freeimage.freeimage; // images (3)
import derelict.openal.al; // sound (4)
import derelict.freetype.ft; // text fonts (5)
auto loadLibraries()
{
version (Windows)
string lib = "../libraries/windows/";
else version (linux)
string lib = "../libraries/linux/";
else version (POSIX)
string lib = "../libraries/apple/";
else
throw new Exception("version not found");
DerelictGLFW3.load(lib); // (1)
if (glfwInit() == 0)
throw new Exception("Loading GLFW3 failed");
DerelictGL3.load(lib); // (2a) loads only the functions for
OpenGL 1.0 and 1.1
glfwSetErrorCallback(&error_callback);
// Set all the required options for GLFW
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE);
// this window is created because context is required for
DerelictGL3.reload()
auto win = glfwCreateWindow(0, 0, "context", null, null);
if (!win)
throw new Exception("GLFW failed to creation a window.");
glfwMakeContextCurrent(win);
DerelictGL3.reload(lib); // (2b) load OpenGL versions 1.2+
and ARB and EXT extens
// ================== ABOVE LINE FAILS TO COMPILE HERE
DerelictFI.missingSymbolCallback = &myMissingSymbolCallBack;
DerelictFI.load(lib); // (3) Load the FreeImage library
DerelictAL.load(lib); // (4) Load the OpenAL library
called.
DerelictFT.load(lib); // (5) Load the FreeType library
return win;
}
More information about the Digitalmars-d-learn
mailing list