3 * (c) 2016 K.Ohta <whatisthis.sowhat@gmail.com>
5 * Renderer with OpenGL v3.0 (extend from renderer with OpenGL v2.0).
7 * Jan 22, 2016 : Initial.
10 #ifndef _QT_COMMON_GLUTIL_3_0_H
11 #define _QT_COMMON_GLUTIL_3_0_H
13 #include "qt_glutil_gl2_0.h"
14 #include <QOpenGLFunctions_3_0>
16 class DLL_PREFIX GLDraw_3_0 : public GLDraw_2_0
20 QOpenGLFunctions_3_0 *extfunc_3_0;
21 VertexTexCoord_t vertexTmpTexture[4];
22 QOpenGLShaderProgram *tmp_shader;
23 QOpenGLShaderProgram *grids_shader;
25 QOpenGLBuffer *buffer_vertex_tmp_texture;
26 QOpenGLVertexArrayObject *vertex_tmp_texture;
28 QOpenGLBuffer *grids_horizonal_buffer;
29 QOpenGLVertexArrayObject *grids_horizonal_vertex;
30 QOpenGLBuffer *grids_vertical_buffer;
31 QOpenGLVertexArrayObject *grids_vertical_vertex;
34 GLuint uTmpFrameBuffer;
35 GLuint uTmpDepthBuffer;
36 void setNormalVAO(QOpenGLShaderProgram *prg, QOpenGLVertexArrayObject *vp,
37 QOpenGLBuffer *bp, VertexTexCoord_t *tp, int size = 4);
39 void drawGridsHorizonal(void);
40 void drawGridsVertical(void);
41 virtual void updateGridsVAO(QOpenGLBuffer *bp,
42 QOpenGLVertexArrayObject *vp,
46 virtual void drawGridsMain_3(QOpenGLShaderProgram *prg,
48 QOpenGLVertexArrayObject *vp,
50 GLfloat lineWidth = 0.2f,
51 QVector4D color = QVector4D(0.0, 0.0, 0.0, 1.0));
53 void drawMain(QOpenGLShaderProgram *prg, QOpenGLVertexArrayObject *vp,
55 VertexTexCoord_t *vertex_data,
57 QVector4D color, bool f_smoosing,
58 bool do_chromakey = false,
59 QVector3D chromakey = QVector3D(0.0f, 0.0f, 0.0f));
61 GLDraw_3_0(GLDrawClass *parent, EMU *emu = 0);
64 void initLocalGLObjects(void);
65 void uploadMainTexture(QImage *p, bool chromakey);
66 void drawScreenTexture(void);
68 void setBrightness(GLfloat r, GLfloat g, GLfloat b);
69 void do_set_texture_size(QImage *p, int w, int h);