git-svn-id: svn://db.shs.com.ru/libs@626 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
62
qglengine/renderer_base.h
Normal file
62
qglengine/renderer_base.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
QGLView
|
||||
Copyright (C) 2019 Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef RENDERER_BASE_H
|
||||
#define RENDERER_BASE_H
|
||||
|
||||
#include "glshaders_types.h"
|
||||
#include "gltexturearray.h"
|
||||
#include "glbuffer.h"
|
||||
|
||||
|
||||
class RendererBase {
|
||||
public:
|
||||
RendererBase(QGLView * view_);
|
||||
~RendererBase();
|
||||
|
||||
protected:
|
||||
void initTextureArrays();
|
||||
void initUniformBuffer (QOpenGLShaderProgram * prog, Buffer * buffer, int bind_point, const char * blockName);
|
||||
void setUniformHalo (QOpenGLShaderProgram * prog, const char * type, QColor color, float fill);
|
||||
void setUniformMaps (QOpenGLShaderProgram * prog);
|
||||
void setUniformCamera (QOpenGLShaderProgram * prog, Camera * cam, bool matrices = true, QSize viewport = QSize());
|
||||
void setUniformViewCorners(QOpenGLShaderProgram * prog, Camera * cam, QSize viewport = QSize());
|
||||
void reloadMaterials(Scene & scene);
|
||||
void reloadLightsParameters(const QList<Light*> & lights);
|
||||
void reloadLightsPositions (const QList<Light*> & lights, Camera * cam);
|
||||
void markReloadTextures();
|
||||
void setMapsSize(QSize sz);
|
||||
void initQuad(Mesh * mesh, QMatrix4x4 mat = QMatrix4x4());
|
||||
void renderQuad(QOpenGLShaderProgram * prog, Mesh * mesh, Camera * cam = 0);
|
||||
|
||||
QGLView * view;
|
||||
TextureManager * textures_manager;
|
||||
QVector<QGLEngineShaders::Object> cur_objects_;
|
||||
QVector<QGLEngineShaders::QGLMaterial> cur_materials_;
|
||||
QVector<QGLEngineShaders::QGLLightParameter> cur_lights_params_;
|
||||
QVector<QGLEngineShaders::QGLLightPosition> cur_lights_pos_;
|
||||
QVector<uchar> cur_selections_;
|
||||
Buffer buffer_materials;
|
||||
Buffer buffer_lights, buffer_lights_pos;
|
||||
Texture2DArray textures_empty, textures_maps;
|
||||
QSize maps_size;
|
||||
uint maps_hash;
|
||||
|
||||
};
|
||||
|
||||
#endif // RENDERER_BASE_H
|
||||
Reference in New Issue
Block a user