5#include <QOpenGLFunctions>
6#include <QOpenGLShaderProgram>
66template<
size_t N = 3,
typename T = GL
float>
67std::array<T, N>
array(
const QVector3D vect, T value = 1);
93template<
typename VertexType,
typename FieldType>
104#include <xgl/utils.hpp>
Definition DemoRenderer.h:6
_XGL_FUNC QImage getTransparentImage(const QImage &src_image, int alpha)
Turms the given image into a transparent one.
_XGL_FUNC QMatrix4x4 getPerspectiveMatrix(float fov_y, float aspect, float near_z, float far_z)
createPerspectiveMatrix Generates a perspective projection matrix using QMatrix4x4....
_XGL_FUNC std::pair< GLsizei, std::string_view > getTypeInfo(GLenum type)
Gets the C++ type and GLSL type as a string and the size in bytes of the given type enumerate.
std::array< GLfloat, 16 > matrix4x4f
Type which correspond with a GLSL type and used to implement Vertex structures.
Definition Types.h:13
_XGL_FUNC bool checkDrawMode(GLenum mode, size_t vertice_count, const std::string &src)
Checks is the needed vertices are sufficient and in range.
_XGL_FUNC matrix4x4f getPerspectiveMatrixF(GLfloat fovY, GLfloat aspect, GLfloat nearZ, GLfloat farZ)
Gets the perspective matrix similar to GLU gluPerspective() function.
void setVertexAttribPointer(QOpenGLShaderProgram *sp, GLuint attr_loc, size_t offset)
Makes a call to glVertexAttribPointer() and to glEnableVertexAttribArray() in a smart way.
std::array< T, N > array(const QVector3D vect, T value=1)
Template function to gets a 'std::array' from a Vector3D. This function is to pass a 3D vector where ...
constexpr GLenum getTypeEnum()
Converts the template type into a OpenGL type value like GL_INT, GL_FLOAT, Double.
_XGL_FUNC QMatrix4x4 getRotationMatrix(const QVector3D &v1, const QVector3D &v2)
Gets a 4x4 matrix from to vectors. When the 'v1' vector is mapped using the matrix the 'v2' vector is...
#define _XGL_FUNC
Definition xgl/global.h:34