2

I want to use the nice z-buffer functions of OpenGL, but I really don't want my program to open a window each time it runs (because I want it run as fast as possible).

I am quite new to OpenGL, and I followed the tutorial to learn it. In the tutorial every example starts with:

  1. initialize GLFW
  2. open a window
  3. initialize GLEW
  4. the real stuff

So I was thinking: hmm, since I only want to keep the real stuff, let's get rid of step 1-3. --I ended up with "segmentation error"

Then I was thinking: well, maybe GLEW is related to my real stuff, but GLFW, by its name, only does the window stuff. So I tried deleting step 1, and deleting step 1-2. --Both gave me a "failed to initialize GLEW"

Now I'm confused... What should I do?

genpfault
  • 51,148
  • 11
  • 85
  • 139

2 Answers2

2

I use OpenGL with GLFW + GLEW in a multi-platform system [Windows, Mac and Linux].

The error you are having smells like missing:

glewExperimental = GL_TRUE;

Google for it so you can understand a little more.

What platform are you on?

Wagner Patriota
  • 5,494
  • 26
  • 49
  • I found I only needed the glewExperimental flag when using Nvidia cards, which was quite a frustrating experience trying to identify why things were breaking when moving from AMD to Nvidia hardware. – Lionel Feb 06 '15 at 06:12
2

Unless I'm confused, GLFW is also responsible for setting up the OpenGL context which you will need regardless if you want to render the buffers to screen or not.

Lionel
  • 326
  • 1
  • 4