20 #ifndef _STELRENDERER_HPP_
21 #define _STELRENDERER_HPP_
27 #include "StelApp.hpp"
28 #include "StelCore.hpp"
29 #include "StelGLSLShader.hpp"
30 #include "StelIndexBuffer.hpp"
31 #include "StelRendererStatistics.hpp"
32 #include "StelVertexAttribute.hpp"
33 #include "StelVertexBuffer.hpp"
34 #include "StelViewportEffect.hpp"
35 #include "StelTextureNew.hpp"
36 #include "StelTextureParams.hpp"
97 enum TextureDataFormat
100 TextureDataFormat_RGBA_F32
160 TextParams(
const float x,
const float y,
const QString&
string)
161 : position_(x, y, 0.0f)
163 , angleDegrees_(0.0f)
168 , doNotProject_(true)
185 : position_(position3D[0], position3D[1], position3D[2])
187 , angleDegrees_(0.0f)
191 , projector_(projector)
192 , doNotProject_(false)
199 angleDegrees_ = angle;
261 virtual bool init() = 0;
314 bool dontProject =
false)
347 bool dontProject =
false)
358 virtual void drawLine(
const float startX,
const float startY,
359 const float endX,
const float endY);
374 virtual void drawRect(
const float x,
const float y,
375 const float width,
const float height,
376 const float angle = 0.0f) = 0;
391 const float width,
const float height,
392 const float angle = 0.0f) = 0;
417 virtual void setFont(
const QFont& font) = 0;
462 const TextureLoadingMode loadingMode = TextureLoadingMode_Normal)
465 Q_ASSERT_X(!filename.endsWith(
".pvr"), Q_FUNC_INFO,
466 "createTexture() can't load a PVR texture directly, as PVR "
467 "support may not be implemented by all Renderer backends. Request "
468 "a non-PVR texture, and if a PVR version exists and the backend "
469 "supports it, it will be loaded.");
470 Q_ASSERT_X(!filename.isEmpty(), Q_FUNC_INFO,
471 "Trying to load a texture with an empty filename or URL");
472 Q_ASSERT_X(!(filename.startsWith(
"http://") && loadingMode == TextureLoadingMode_Normal),
474 "When loading a texture from network, texture loading mode must be "
475 "Asynchronous or LazyAsynchronous");
502 Q_ASSERT_X(!image.isNull(), Q_FUNC_INFO,
"Trying to create a texture from a null image");
537 (
const void*
const data,
const QSize size,
const TextureDataFormat format,
540 Q_ASSERT_X(NULL != data, Q_FUNC_INFO,
"Trying to load a texture from a NULL pointer to data");
543 Q_ASSERT_X(format != TextureDataFormat_RGBA_F32, Q_FUNC_INFO,
544 "Trying to load a floating-point texture even though "
545 "float textures are not supported");
573 Q_ASSERT_X(
false, Q_FUNC_INFO,
574 "Trying to create a GLSL shader with a renderer backend that doesn't "
602 void setGlobalColor(
const float r,
const float g,
const float b,
const float a = 1.0f)
612 virtual void setBlendMode(
const BlendMode blendMode) = 0;
679 (
const PrimitiveType primitiveType,
const QVector<StelVertexAttribute>& attributes) = 0;
687 const bool dontProject) = 0;
697 const TextureLoadingMode loadingMode) = 0;
716 (
const void* data,
const QSize size,
const TextureDataFormat format,
739 #endif // _STELRENDERER_HPP_