Code Monkey home page Code Monkey logo

Comments (14)

nigels-com avatar nigels-com commented on August 18, 2024

Interesting.

I can see that auto/Makefile is supposed to be substituting these in glew.c...

    perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@
    perl -e "s/GLEW_VERSION_MAJOR_STRING/$(GLEW_MAJOR)/g" -pi $@
    perl -e "s/GLEW_VERSION_MINOR_STRING/$(GLEW_MINOR)/g" -pi $@
    perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@

from glew.

nigels-com avatar nigels-com commented on August 18, 2024

Oh, looks like these are constant, for querying glewGetString

const GLubyte * GLEWAPIENTRY glewGetString (GLenum name)
{
  static const GLubyte* _glewString[] =
  {
    (const GLubyte*)NULL,
    (const GLubyte*)"1.11.0",
    (const GLubyte*)"1",
    (const GLubyte*)"11",
    (const GLubyte*)"0"
  };
  const size_t max_string = sizeof(_glewString)/sizeof(*_glewString) - 1;
  return _glewString[(size_t)name > max_string ? 0 : (size_t)name];
}

Not a bug?

from glew.

stopiccot avatar stopiccot commented on August 18, 2024

Hm, but it's still useful to have version constants in header file so you can determine glew version while configuring. Not in runtime.

from glew.

nigels-com avatar nigels-com commented on August 18, 2024

Something along the lines of pkg-config?

pkg-config --modversion  glew

from glew.

stopiccot avatar stopiccot commented on August 18, 2024

Maybe... But I was talking about cmake configure and I'm not sure than pkg-config approach works for OS X not talking abount Windows. So constants-in-header approach seems more cross-platform friendly for me. Actually many libraries (SDL2, glfw for example) have both configure/compile time version defines in headers and runtime function to get version because runtime version can differ from compile version.

from glew.

nigels-com avatar nigels-com commented on August 18, 2024

Renaming this issue to: Feature Request: GLEW_VERSION from glew.h

from glew.

stopiccot avatar stopiccot commented on August 18, 2024

So... Any chance this feature request gets implemented any soon?

from glew.

nigels-com avatar nigels-com commented on August 18, 2024

Yeah, I'm not really opposed to it.
But I don't want to hold up a GLEW release at the moment...

from glew.

nigels-com avatar nigels-com commented on August 18, 2024

I happened across a similar feature in libpng this week.
http://sourceforge.net/p/libpng/code/ci/master/tree/png.h

Is this a good model to use?

#define PNG_LIBPNG_VER_MAJOR   1
#define PNG_LIBPNG_VER_MINOR   6
#define PNG_LIBPNG_VER_RELEASE 16

from glew.

stopiccot avatar stopiccot commented on August 18, 2024

yeah something like that

from glew.

stopiccot avatar stopiccot commented on August 18, 2024

I've created pull request that fixes that issue in a backwards compatible way #33

from glew.

nigels-com avatar nigels-com commented on August 18, 2024

Thanks for the pull request. I put some comments over there too, do you mind revisiting this?

from glew.

nigels-com avatar nigels-com commented on August 18, 2024

I put a change into github master branch. Does it seem sufficient?

from glew.

stopiccot avatar stopiccot commented on August 18, 2024

At first look it's fine. Thanks.

from glew.

Related Issues (20)

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.