• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
riverreal

OpenGL core profile question

6 posts in this topic

I'm trying to learn the modern opengl with the core profile (+3.x) but I don't know the best way to initialize the opengl extensions.

 

Glew was a headache for me. I initialized it (and enabled glew experimental) but for some reason I had problems generating vertex arrays. I think it's because I defined the opengl profile to core profile with glfw, but I'm not sure.

 

There is a good opengl core profile tutorial? 

 

By the way, I'm using windows 7 64bits with Visual C++ 2010 express. 

 

Thanks in advance.

0

Share this post


Link to post
Share on other sites

The OpenGL wiki itself has a few tutorials on the subject, though they're not using glfw.

 

Though I'd guess that the way you use vertex arrays or something related is the problem itself - if you got the context without any errors, it was probably working correctly. The OpenGL vertex array object thing makes no sense anyways. I'd double check that you're actually getting an error of some sort from GLFW or GL related to context creation, not the rendering code itself, before jumping into conclusions. Checking for errors is usually a good idea anyway.

 

The way I like to use OpenGL extensions is with a small offline script that generates me a header with all the function pointers and a function to load all the extensions based on a core specification I give as a parameter. It took a couple of nights to code, but works like a charm and whenever the ARB releases a new header, I can just ask for the new core (when the drivers arrive, of course) without being tied to anyone elses code.

1

Share this post


Link to post
Share on other sites

The OpenGL wiki has a page on some of the common extension loading libraries as well as a page on loading extensions manually.

 

I know you already said that you dislike GLEW, but maybe you should post some code so we can find out why it isn't working. I've used both GLEW and GL3W with OpenGL 3.X before and have had no major problems. Try adding some error checking code:


GLenum err = glewInit();
if (GLEW_OK != err)
{
  /* Problem: glewInit failed, something is seriously wrong. */
  fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
}

 

You could also attempt to load a specific extension as described here.

Edited by Josh Vega
1

Share this post


Link to post
Share on other sites

The OpenGL wiki has a page on some of the common extension loading libraries as well as a page on loading extensions manually.

 

I know you already said that you dislike GLEW, but maybe you should post some code so we can find out why it isn't working. I've used both GLEW and GL3W with OpenGL 3.X before and have had no major problems. Try adding some error checking code:


GLenum err = glewInit();
if (GLEW_OK != err)
{
  /* Problem: glewInit failed, something is seriously wrong. */
  fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
}

 

You could also attempt to load a specific extension as described here.

Thank you.

But I always get an access violation when trying to generate something. (glGenVertexArray, glGenBuffer, even glCreateShader).

 

Do you know why I get this kind of errors?

0

Share this post


Link to post
Share on other sites
For core profiles glew is kinda hit miss afaik. It doesn't support them cleanly. So it is usullay preferable to use a loader like gl3w or glxw.
1

Share this post


Link to post
Share on other sites

But I always get an access violation when trying to generate something. (glGenVertexArray, glGenBuffer, even glCreateShader).

 

Do you know why I get this kind of errors?

 

 

Is your rendering context properly created and current?

0

Share this post


Link to post
Share on other sites

Is it possible to you can post the relevent information from the output window during a build (preferably debug)?

 

I did a quick search for GLEW with OpenGL 3.X tutorials and ran across this page. I'm know that you are using GLFW and this uses Win32/MFC, but maybe the GLEW parts can help you to check against your own code.

 

Another thought that just popped into my head is that maybe GLFW is interfering with GLEW (or vice versa). If its possible, try switching out GLFW for SDL or SFML (or even freeglut) and try testing it again.

 

If all else fails, it might just be easier to switch to GL3W.

 

EDIT: I was just browsing through the forums here and found this thread where the OP has a similar problem to the one you are describing. It may or may not help, but I'm just gonna put it out there for you. You can check the final post for his resolution to the problem.

Edited by Josh Vega
1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0