Giter Site home page Giter Site logo

oglwrap's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

oglwrap's Issues

How to make it work with legacy code

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?

License

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.

Some problem about parameter order

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🤔

No documentation

There is no manual, documentation, or code samples to get started using the library, unfortunately.

Upload array of mat4 uniforms?

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. ^^

Add code samples

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.