title: glGenBuffers is having an access violation even though is glew initialized
body: <p>I'm having a problem rendering my sprite even though I have initialized glew.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>#include &lt;glew.h&gt;
  #include &lt;wglew.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;iostream&gt;
  #include &lt;gl\GL.h&gt;
  #include &lt;SDL.h&gt;
  #include "SDL_image.h"
  
  GLuint _texturebufferID;
  GLuint _vertexBufferID;
  GLuint texturebufferID;
  
  int SCREEN_WIDTH = 740;
  int SCREEN_HEIGHT = 520;
  int mode;
  
  bool processing = true;
  
  SDL_Surface* image;
  SDL_Window* window;
  SDL_Renderer* renderer;
  SDL_GLContext context;
  SDL_Surface* surface;
  SDL_Event window_key;
  
  typedef struct {
  
  GLfloat positionCoordinates[3];
  GLfloat textureCoordinates[2];
  
  } Texture;
  
  Texture vertices[] =
  { 
  //  |        Pixels       |--|coords|
      {{1.0f,     0.0f, 0.0f}, {0.0f,   0.0f}},
      {{0.0f,    43.0f, 0.0f}, {0.0f,   1.0f}},
      {{168.0f,  43.0f, 0.0f}, {1.0f,   1.0f}},
      {{168.0f,   0.0f, 0.0f}, {1.0f,   0.0f}}
  
  };
  
  GLuint loadandbuffersprite(const char *filename)
  {
  image = IMG_Load(filename); 
  
  if (image-&gt;format-&gt;BytesPerPixel == 3)
  {
      mode = GL_RGB;
  }
  
  else if (image-&gt;format-&gt;BytesPerPixel == 4)
  {
      mode = GL_RGBA;
  }
  
  else
  {
      SDL_FreeSurface(image);
      return 0;
  }
  
  glGenTextures(1, &amp;texturebufferID);
  glBindTexture(GL_TEXTURE_2D, texturebufferID);
  glTexImage2D(GL_TEXTURE_2D, 0, mode, image-&gt;w, image-&gt;h,
      0, mode, GL_UNSIGNED_BYTE, image-&gt;pixels);
  
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
  
  SDL_FreeSurface( image );
  
  return texturebufferID;
  }
  
  void render()
  {
  
      glEnable(GL_TEXTURE_2D);
      glEnable(GL_BLEND);
      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  
      glMatrixMode(GL_PROJECTION);
      glMatrixMode(GL_MODELVIEW);
  
      glGenBuffers(1, &amp;_vertexBufferID);
      glBindBuffer(GL_ARRAY_BUFFER, _vertexBufferID);
      glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices,
          GL_STATIC_DRAW);
  
      glEnableClientState(GL_VERTEX_ARRAY);
      glVertexPointer(3, GL_FLOAT, sizeof(Texture), (GLvoid *) 
          offsetof(Texture, positionCoordinates));
  
      glEnableClientState(GL_TEXTURE_COORD_ARRAY);
      glTexCoordPointer(2, GL_FLOAT, sizeof(Texture), (GLvoid *) 
          offsetof(Texture, textureCoordinates));
  
      glLoadIdentity();
  
      _texturebufferID = loadandbuffersprite("hane_stand.png");
  }
  
  // |----------------------------------------|
  // |             Main function              |
  // |----------------------------------------|
  
  int main(int argc, char *argv[])
  {
  
      SDL_Init(SDL_INIT_EVERYTHING);
      // Intialize everything.
  
      window = SDL_CreateWindow
          (
          "render example",
          SDL_WINDOWPOS_CENTERED,
          SDL_WINDOWPOS_CENTERED,
          SCREEN_WIDTH,
          SCREEN_HEIGHT,
          SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE
          ); 
      // Create window for rendering.
  
      glewInit();
  
      renderer = SDL_CreateRenderer(window, -1, 0); 
  
      context = SDL_GL_CreateContext(window);
  
      SDL_GL_MakeCurrent(window, context);
  
      SDL_GL_LoadLibrary( NULL );
  
      glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
      // Clearing color
  
      glViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
      // Set viewport
  
  
  // |----------------------------------------|
  // |                Game loop               |
  // |----------------------------------------|
  
      while (processing)
      {
  
      glClear(GL_COLOR_BUFFER_BIT);
  
  
      render();
  
      glDrawArrays(GL_QUADS, 0, 4);
  
      SDL_RenderPresent(renderer);
      SDL_GL_SwapWindow(window);
  
      }
  
      glDeleteTextures( 1, &amp;texturebufferID);
  
      SDL_DestroyWindow(window); 
  
      SDL_Quit();
  
      return 0;
  }
  </code></pre>
  
  <p>It's just this problem that's been hammering my coding progression for months and really need help. Anyone have any ideas on how I could fix this?</p>
  
  <p>As for my computer information I use a Toshiba satellite with an AMD C-50 Processor and 2.0 GB of RAM.</p>