pro文件
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = untitled49
TEMPLATE = app
SOURCES += main.cpp\
HEADERS +=
FORMS +=
LIBS+=-lGLEW
QT+=opengl
CONFIG+=c++11
main.cpp
#include <GLTools/GLEWTool.h>
#include <GLTools/QGLTools.h>
#include <QApplication>
#include <iostream>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QGLWidget w;
QGLTools::QGLWidgetInitializeGlew(&w);
w.show();
const static char hellowowrd[] ="0ellow Word!";
GLuint buffer ;
glGenBuffers(1,&buffer);
glBindBuffer(GL_ARRAY_BUFFER,buffer);
glBufferData(GL_ARRAY_BUFFER,sizeof(hellowowrd),hellowowrd,GL_STATIC_DRAW);
void * wptr