Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
ejmapwidget.cpp 631 Bytes
Copy Edit Web IDE Raw Blame History
unix_chen authored 2018-03-26 07:59 . init
#include "ejmapwidget.h"
EjMapWidget::EjMapWidget(QWidget *parent)
: QOpenGLWidget(parent)
{
}
void EjMapWidget::initializeGL()
{
//调用内容初始化函数
initializeOpenGLFunctions();
}
void EjMapWidget::resizeGL(int w, int h)
{
//当窗口大小改变时,调整界面坐标显示高度和宽度
glViewport(0, 0, w, h);
}
void EjMapWidget::paintGL()
{
//清除之前图形并将背景设置为黑色(设置为黑色纯粹个人爱好!)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
}
void EjMapWidget::keyPressEvent(QKeyEvent *e)
{
}

Comment ( 0 )

Sign in for post a comment