What versions of SDL and OpenGL and implementation do I use

I downloaded SDL 1.2.14 on Windows 7 and I have the Mobility Radeon X1800 driver installed.

I am using Microsoft Visual C ++ 2010 Express.

I have added include directories and SDL libraries to "VC ++ Directories"

I added the following additional dependencies: opengl32.lib; glu32.lib; SDL.lib; SDLmain.lib;

I added SDL.dll to my program folder

I did not add opengl directories!

#include "SDL.h"
#include "SDL_opengl.h"

bool running = true;

int main(int argc, char* args[]) {
  SDL_Init(SDL_INIT_EVERYTHING);
  SDL_Surface* screen = SDL_SetVideoMode(640,480,32,SDL_OPENGL);

  glViewport(0,0,640,480);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(45.0, 640/480, 1.0, 200.0);

  while(running) {
    glClear(GL_COLOR_BUFFER_BIT |GL_DEPTH_BUFFER_BIT);

    glMatrixMode(GL_MODELVIEW); // Swich to the drawing perspective
    glLoadIdentity();
    glTranslatef(0.0,0.0,-5.0);

    glBegin(GL_TRIANGLES);
      glVertex3f(-0.5f, 0.5f, 0.0f);
      glVertex3f(-1.0f, 1.5f, 0.0f);
      glVertex3f(-1.5f, 0.5f, 0.0f);
    glEnd();

    SDL_GL_SwapBuffers();
  }

  SDL_Quit();
  return 0;
}

This program draws a simple triangle. I include 2 header files above and my Opengl code only works!

I do not know if my triangle works on a GPU or processor. And what version of openGL am I using?

I mean, I heard that Microsoft no longer updates opengl files and that they use the OpenGL 1.1 CPU implementation or something like that.

, OpenGL ? ?

, ? ?

, .

+3
2

glGetString

Microsoft glGetString. SGI , gl.h opengl32.lib.

+3

, , "" opengl, , .

OpenGL, HDC, OpenGL. , , , GL, , , (Ben Voigt)

lib, Visual Studio, OpenGL 1.1, wglGetProcAddress, .

: http://www.opengl.org/wiki/Getting_started

+1

Source: https://habr.com/ru/post/1782724/


All Articles