问题描述
我下载了SDL 1.2.14在Windows 7上并且我已经安装了Mobility Radeon X1800驱动程序.
I downloaded SDL 1.2.14on Windows 7and I have Mobility Radeon X1800 driver installed.
我正在使用Microsoft Visual C ++ 2010 Express.
I'm using Microsoft Visual C++ 2010 Express.
我在"VC ++目录"中添加了SDL包含和库目录
I added the SDL include and library directories in the "VC++ Directories"
我添加了以下其他依赖项: opengl32.lib; glu32.lib; SDL.lib; SDLmain.lib;
I added the following Additional Dependencies: opengl32.lib; glu32.lib; SDL.lib; SDLmain.lib;
我将SDL.dll添加到了程序文件夹中
I added the SDL.dll to my program folder
我没有添加任何opengl目录!
I didn't add any 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;
}
该程序绘制一个简单的三角形.我在上面包括了2个头文件,而我的Opengl代码才起作用!
This program draws a simple triangle.I include 2 header files above and my Opengl code just works!
我不知道我的三角形是在GPU还是CPU上完成的.以及我使用的是哪个openGL版本?
I don't know if my triangle is done on a the GPU or CPU. And what openGL version I'm using?
我的意思是,我听说微软不再在其中更新opengl文件,并且它们使用OpenGL 1.1等的CPU实现.
I mean i heard that Microsoft don't update there opengl files any longer and that they use CPU implementation of OpenGL 1.1 or something.
我怎么知道我正在使用哪个版本的OpenGL?我可以在运行时检查吗?
How do I know what version of OpenGL I'm using? And can I check at run time?
如何知道我使用的是CPU还是GPU?我可以在运行时检查吗?
How do I know if I'm using a CPU or GPU implementation? And can I check at run time?
感谢您查看我的问题.
推荐答案
调用 glGetString
此处是Microsoft的glGetString
文档. SGI文档,并告诉您该功能可以在gl.h
和opengl32.lib
中找到.
这篇关于我正在使用什么SDL和OpenGL版本及实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!