Giter Club home page Giter Club logo

glbinding's People

Contributors

0xb8 avatar adsun701 avatar arsenic-atg avatar automaticp avatar billyoneal avatar cgcostume avatar cy20lin avatar dgimb89 avatar dommueller avatar dutow avatar ghisvail avatar jon-edward avatar jpgygax68 avatar julkw avatar karjonas avatar lw0 avatar mjendruk avatar morwenn avatar murashin avatar naios avatar pfultz2 avatar rlux avatar ryanshow avatar ryp avatar scheibel avatar somae avatar stephantlavavej avatar tachi107 avatar v1993 avatar zangetsu38 avatar

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

glbinding's Issues

Specs Wishlist

A list of ToDos and issues for the XML-based OpenGL spec:

  • every Parameter or Return value of type GLbitfield should be replaced by appropriate bitfield group
  • every Parameter or Return value of type GLenum should be replaced by appropriate enum group
  • more to come ...

Shared library on Mac OS X has wrong install name

I have built and installed glbinding on Mac OS X 10.10.2 with XCode 6.2 and all the default options. However, the install name of the installed library seems wrong:

$ otool -D /usr/local/lib/libglbinding.dylib
/usr/local/lib/libglbinding.dylib:
libglbinding.dylib

The full path should be listed instead of only the filename. The expected output would be:

$ otool -D /usr/local/lib/libglbinding.dylib
/usr/local/lib/libglbinding.dylib:
/usr/local/lib/libglbinding.dylib

As a work-around, one can run this command to fix the install name:

$ sudo install_name_tool -id /usr/local/lib/libglbinding.dylib /usr/local/lib/libglbinding.dylib

But with the proper cmake settings, this should not be necessary.

Probably related is the following warning from cmake:

CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   glbinding

Conflicting "None" in glbinding/callbacks.h with X11/X.h

/usr/include/glbinding/callbacks.h:30:5: error: expected identifier before numeric constant
enum class CallbackMask : unsigned char
{
None = 0x00,
...
};

None was declared in X11/X.h as:

ifndef None

define None 0L /* universal null resource or null atom */

endif

Maybe this will work:

if defined X_H

undef None

endif

enum class CallbackMask : unsigned char
{
None = 0x00,
Unresolved = 0x01,
Before = 0x02,
After = 0x04,
Parameters = 0x08,
ReturnValue = 0x10,
ParametersAndReturnValue = Parameters | ReturnValue,
BeforeAndAfter = Before | After
};

if defined X_H

define None 0L /* universal null resource or null atom */

endif

Including <glbinding/gl/gl.h> slows down compilation massively

You probably know about this - is there really nothing that can be done about it? I just cut down the compilation time of a small project from just about 3 minutes to 55 seconds by replacing a dozen or so gl.h with the actually needed types.h, enum.h, bitfield.h, functions.h... The thing is just, this is a lot of manual work.
I'd rather like to be able to just include gl.h and be able to use GL without killing my build times. Can we maybe outsource some non-GL functionality from gl.h to external headers? Maybe employ defines to disable features we don't need?

(I haven't bothered to figure out what's actually going on in gl.h, just pointing this out in general)

The problem I got

When I run the examples "meta" (glbinding make with GL_BY_STRINGS) the program crashed at Meta_BitfieldsByString.cpp line 13. And I tested when write block of code like that with my own, my program also crashed(may be vs12 not support this kind of code).
And when I run the example "callbacks" I got problem at Function.hpp line 30 with a error message "Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call". (enum class value can not as an interger?).
(I run this program in windows 7 and build it with visual studio 2013)

Discuss about handling symbol names

A lot of other libraries define macros which clash with the opengl symbols.
Currently we add underscores to avoid that.

Is there a better way?

Per-feature types include

Currently, per-feature type declarations only exist in the functions....h header, which seems rather large just to get a few type declarations.

Convert classes with no members

glbinding contains several classes without members, so why not transforming it to a namespace?

Currently found classes:

  • Binding
  • Meta
  • ContextInfo

Building Static Library Error

The following error occurs when trying to build as a static library.

CMake Error at source/glbinding/CMakeLists.txt:162 (install):
  install TARGETS given no ARCHIVE DESTINATION for static library target
  "glbinding".

Get a homebrew recipe in place

It should not take more than brew install glbinding on Mac OS to get started.

Homebrew (http://brew.sh/) has become the de-facto standard of installing libraries and unix tools on Mac OS. glbinding adoption is definitively slowed down on Mac OS through not providing a brew recipe in the mainline of homebrew.

Duplicated 'revision' file

Hi,
I just built glbinding with:

mkdir build-release
cd build-release
cmake .. # I used ccmake, but it doesn't matter now
make
make pack

I tried to install generated packages with

sudo dpkg -i glbinding-1.0.5-dev.deb glbinding-1.0.5-runtime.deb 

but dpkg complains that there's conflict because glbinding-runtime.deb tries to overwrite file /usr/share/glbinding/revision which belongs to glbinding-dev.deb

Edit: It can be fixed with --force-overwrite option added to dpkg invocation, but I think it's not the way.

Can not build using clang on Linux

When trying to build on a Ubuntu Travis-CI worker with clang-3.5, I get many error messages like this:

In file included from /home/travis/build/xythobuz/OpenRaider/glbinding/source/glbinding/source/Binding.cpp:2:
In file included from /home/travis/build/xythobuz/OpenRaider/glbinding/source/glbinding/include/glbinding/Binding.h:9:
/home/travis/build/xythobuz/OpenRaider/glbinding/source/glbinding/include/glbinding/gl/types.h:102:1: error: 
      'hash' defined as a struct template here but previously declared as a
      class template [-Werror,-Wmismatched-tags]
struct hash<gl::GLenum>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_bvector.h:523:31: note: 
      did you mean struct here?
    template<typename> friend class hash;

I have removed the -Werror compiler flag in cmake/PlatformLinuxGCC.cmake as a work-around. That allows me to build the library.

Value.cpp wrapString() segfaults on nullptr

The implementation of wrapString() does not expect a nullptr value. This can cause the program to crash.

I've noticed this problem when attaching an After callback and calling glGetString() with an invalid enum. Trying to print the return value (which is nullptr in this case) will cause a segfault. The problem could easily be fixed by replacing:

ss << value;

by

ss << ((value == nullptr) ? "nullptr" : value);

Ambiguous call to overloaded function when using per-feature includes

The following snippet produces error C2668: 'gl45core::glGetUniformSubroutineuiv' : ambiguous call to overloaded function

#include <glbinding/gl/functions.h>  // < imagine this was included by a 3rd party library (e.g. globjects.hpp)

#include <glbinding/gl/functions45core.h>
#include <glbinding/gl/enum45core.h>

using namespace gl45core;

int main(int argn, char** argv) {
    GLuint index = 0;
    glGetUniformSubroutineuiv(GL_VERTEX_SHADER, 0, &index);
}

Full log:

1>c:\users\jole\documents\visual studio 2013\projects\glbindingambiguity\glbindingambiguity\main.cpp(10): error C2668: 'gl45core::glGetUniformSubroutineuiv' : ambiguous call to overloaded function
1>          d:\projects\glbinding\source\glbinding\include\glbinding\gl\functions45core.h(311): could be 'void gl45core::glGetUniformSubroutineuiv(gl45core::GLenum,gl45core::GLint,gl45core::GLuint *)'
1>          d:\projects\glbinding\source\glbinding\include\glbinding\gl\functions.h(1017): or       'void gl::glGetUniformSubroutineuiv(gl::GLenum,gl::GLint,gl::GLuint *)' [found using argument-dependent lookup]
1>          while trying to match the argument list '(const gl::GLenum, int, gl45core::GLuint *)'

If the first line is removed, the program compiles as expected. The problem is caused by argument dependent lookup and the fact that enums constants in the gl45core namespace use a type from the gl namespace. In order to fix this, per-feature declarations should be fully independent from the gl namespace.

Strongly-typed enums conflicts with regular gl use

Consider this example:

GLuint buffer;
GLuint buffer2;
GLsizei size;
void* ptr;
GLbitfield flags = GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT; // Not compiling

glNamedBufferStorage(buffer, size, ptr, flags);
glNamedBufferStorage(buffer2, size, ptr, flags);

This isn't allowed by glbinding as far as as I know, due to the lack of conversion of the Mask* types to GLbitfield. But this kind of uses are often encountered in OpenGL code. This problem also arise when wrapping glbinding functions into objects.

// OpenGL reference
void glNamedBufferStorage(GLuint buffer, GLsizei size, const void *data, GLbitfield flags);
// glbinding
void glNamedBufferStorage(GLuint buffer, GLsizei size, const void * data, MapBufferUsageMask flags)

Build error with GCC after version 1.0.4

I'm compiling glbinding with TDM GCC 4.9.2 64 bit in Windows 7.

With glbinding 1.0.4 I never had problems, while with 1.0.5 the compiler gives me "unrecognized command line options" error.

Removing this instruction @ line 137 in "source/glbinding/CMakeLists.txt" from glbinding 1.0.5 sources:

target_compile_options(${target} PRIVATE ${DEFAULT_COMPILE_FLAGS})

resolved the problem. This line was not present in glbinding 1.0.4.

Thank you for your attention and best regards

Current master fails to compile on Visual Studio 2013

There are several problems:

  • warning C4244: 'argument' : conversion from 'unsigned __int64' to 'glbinding::RingBuffer<glbinding::logging::BufferType>::SizeType', possible loss of data (RingBuffer uses SizeType (=unsigned int) in its external interface, but std::int64_t internally)
  • RingBuffer.hpp(93): warning C4127: conditional expression is constant
  • RingBuffer.hpp(133): warning C4389: '!=' : signed/unsigned mismatch
  • callbacks.cpp(32): error C2797: 'glbinding::FunctionCall::parameters': list initialization inside member initializer list or non-static data member initializer is not implemented
  • RingBuffer.h(49): error C2039: 'mutex' : is not a member of 'std' (missing include)
  • error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl glbinding::logging::log(bool)" (__imp_?log@logging@glbinding@@YAX_N@Z) referenced in function "void __cdecl compare(void)" (?compare@@YAXXZ) (and two more)

Warnings must be fixed as well, as they are treated as errors.

Most should be easily fixable, but was there a reason for the first issue?

GL_POINTS (and others) not in Meta_StringsByEnum

This is because of

d = sorted([ es[0] for v, es in groupEnumsByValue(pureEnums).items() ])

in gen_meta.py:68

The obvious fix would be to include all elements of es into the array list instead of just the first but this seems a bit too obvious to me, so I'll just raise this as an issue as there probably was an intend behind just inserting index 0.

LoadLibrary on win32 didn't accept wchar_t*

gcc gives error:

../source/glbinding/source/ProcAddress.cpp: In function 'void (* glbinding::getProcAddress(const char_))()':
../source/glbinding/source/ProcAddress.cpp:27:60: error: cannot convert 'const wchar_t_' to 'LPCSTR {aka const char_}' for argument '1' to 'HINSTANCE___ LoadLibraryA(LPCSTR)'
static HMODULE module = LoadLibrary(L"OPENGL32.DLL");

I'm not sure if this is related to gcc (I use gcc-4.9.1 Rev3 x86-64 from MSYS2)
remove the L prefix fix it

Virtual Contexts

Provide virtual contexts on top of real OpenGL contexts so that one real context can be used with multiple glbinding configurations including

  • global callbacks
  • per function callbacks
  • logging

That also enables applications and depending libraries to use multiple configurations per context, too.

Derived informations from the actual OpenGL context can be shared (e.g. function pointers).

Calling convention run-time check failure

The following program encounters a run-time failure:

#include <SFML\Window.hpp>
#include <glbinding\gl\gl.h>
#include <glbinding\Binding.h>

using namespace gl;

int main(int argc, const char* argv[])
{
    sf::Window window(sf::VideoMode(640, 480), "GLBinding Test");

    glbinding::Binding::initialize();
    glClearColor(0.0f, 0.5f, 0.8f, 1.0f);
   // truncated
}

With the error message:

Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

Which occurs on line 71 of Function.hpp and the call stack for the error originates from the glClearColor call:

template <typename... Arguments>
struct FunctionHelper<void, Arguments...>
{
    void call(const glbinding::Function<void, Arguments...> * function, Arguments&&... arguments) const
    {
        // truncated
        if (function->isEnabled(glbinding::CallbackMask::After))      // line 71
            function->after(functionCall);
    }
};

The toolchain used to build the library:

  • VS 2013 Version 12.0.30723.00 Update 3
  • CMake 3.0.2

The same tools were used to build SFML and GLEW which have no issues with the same program.

GL_FALSE unexpected behaviour

Hi,
I recently tried to extract the shader compilation log with the usual approach:

GLint status;
glGetShaderiv(vertexShader, GL_COMPILE_STATUS, &status);
 if (status == GL_FALSE) {
...
}

But this doesn't compile because of different types (GLint and const gl::GLboolean). From my pov that is not what I expect. Of course I can use !status, but this behaviour breaks the compatibilty, isnt't it?

glbinding cannot be used as a submodule

glbinding cannot currently be used as a submodule. This is because glbinding expects the .git directory to be in it's root source directory, which is not the case when it is cloned as a submodule. When cloned as a submodule however there will be a .git file in it's root source directory with something like gitdir: ../../.git/modules/ThirdParty/glbinding pointing to it's .git directory and it should be able to use this.

global namespace pollution

In files glbinding/include/glbinding/Function.h and other unnamed namespaces are used, so all classes declared insde are in fact global, because it's header file included from gl*.h.
I think such helper classes shouldn't pollute global namespace.
I just had compilation error because of this issue.

Change error checking example in README to not loop callbacks

I tried to use error checking after-callbacks as shown in the main README, but using a glGetError() call in the callback caused it to loop back into the callback. Being new the library, I had no idea why my program became completely unresponsive. After some reading, I found using Binding::GetError.directCall() was the correct way to go.

Maybe the example should be changed so other people don't run into the same issue? Or is this possibly a bug?

Restructure per-feature include header locations

Currently, per-feature include headers are structured this way:

glbinding/gl/functions.h
glbinding/gl/functions10.h
// ...
glbinding/gl/functions32.h
glbinding/gl/functions32core.h
glbinding/gl/functions32ext.h
// ...

I suggest using this structure for glbinding 2.0:

glbinding/gl/functions.h
glbinding/gl10/functions.h
// ...
glbinding/gl32/functions.h
glbinding/gl32core/functions.h
glbinding/gl32ext/functions.h
// ...

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.