tomius / oglwrap Goto Github PK
View Code? Open in Web Editor NEWLightweight OpenGL C++ wrapper.
License: MIT License
Lightweight OpenGL C++ wrapper.
License: MIT License
Hey hey,
I got a bunch of old OpenGL code and I would like to use legacy OpenGL and oglwrap, but I couldn't figure out yet how to make them work together.
What I tried e.g. is to make the hidden handles public and then:
gl::Program proggy;
proggy.program_.handle_ = prog; // prog is GLuint
gl::Uniform<float> u_time(proggy, "u_time");
u_time = (float)Sys_Milliseconds();
But something like this doesn't work. Is ther any "good" way to combine old code with oglwrap?
Hello, I'm searching for a opengl wrapper without many dependencies and oglwrap seems to fit but, is this library used in any production code?
Thanks
Hey Tomius,
you decided for any license yet? Would be nice to have MIT or BSD etc., since GPL has so many strings attached, that companies e.g. don't touch it.
Hey man, just noted this, since I needed to make a x64 build.
https://github.com/Tomius/oglwrap/blob/master/context/synchronization.h#L20
This conflicts with this Windows x64 Macro: https://msdn.microsoft.com/de-de/library/windows/desktop/ms684208(v=vs.85).aspx
Hi, i encoutered some problems when using this framework. i always get the error Invalid Value
on this function(in context/binding.h
):
template<IndexedBufferType BUFFER_TYPE, GLuint index>
void BindRange(const IndexedBufferObject<BUFFER_TYPE, index>& buffer,
GLintptr offset, GLsizeiptr size) {
gl(BindBufferRange(GLenum(BUFFER_TYPE), index, offset, size, buffer.expose()));
}
So i checked its doc https://www.khronos.org/registry/OpenGL-Refpages/gl4/:
void glBindBufferRange(
GLenum target,
GLuint index,
GLuint buffer,
GLintptr offset,
GLsizeiptr size);
So, should the function call be like this ?
gl(BindBufferRange(GLenum(BUFFER_TYPE), index, buffer.expose(), offset, size));
I'm new to OpenGL, mybe my understanding is wrong🤔
There is no manual, documentation, or code samples to get started using the library, unfortunately.
Hey Tomius, currently I wonder how to upload an array of matrices via oglwrap. I searched through the code and I only found this, with count parameter forced to 1:
https://github.com/Tomius/oglwrap/blob/master/uniform.h#L518
#if OGLWRAP_DEFINE_EVERYTHING || defined(glUniform4dv)
template<>
inline void UniformObject<glm::dvec4>::set(const glm::dvec4& vec) {
glUniform4dv(location_, 1, glm::value_ptr(vec));
}
Unfortunately I never learned to properly do template programming and I wonder how this could be implemented.
E.g. when I have 7 bindposes for skeletal animation:
gl::Uniform<glm::mat4[7]> u_bindposes(proggy, "u_bindposes");
Could a template extract the array length?
Or maybe like, with a default value of 1:
gl::Uniform<glm::mat4, 7> u_bindposes(proggy, "u_bindposes");
Or probably something like this, to dynamically set the number of elements:
glm::mat4 matrices[7];
gl::Uniform<glm::mat4> u_bindposes(proggy, "u_bindposes");
u_bindposes.Set(matrices, 7);
Or I'm just missing something, so this might be already possible without falling back to legacy OpenGL. ^^
It's very hard to use this library without some example code showing how to use it, honestly. Even just getting a triangle / quad on screen would be enough.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.