Some clean up, web version prepare
This commit is contained in:
1 parent
e9c888e2bf
commit
0975f3b9cd
104 files changed
+779
-1483
No files matched your search
@@ -2,7 +2,7 @@
|
||||
#include <iostream>
|
||||
#include "Environment.h"
|
||||
|
||||
namespace ZL {
|
||||
namespace FRG {
|
||||
|
||||
FrameBuffer::FrameBuffer(int w, int h, bool useMipmaps)
|
||||
: width(w), height(h), useMipmaps(useMipmaps) {
|
||||
@@ -59,4 +59,4 @@ namespace ZL {
|
||||
glViewport(0, 0, Environment::width, Environment::height);
|
||||
}
|
||||
|
||||
} // namespace ZL
|
||||
} // namespace FRG
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "render/OpenGlExtensions.h"
|
||||
#include <memory>
|
||||
|
||||
namespace ZL {
|
||||
namespace FRG {
|
||||
|
||||
class FrameBuffer {
|
||||
private:
|
||||
@@ -28,4 +28,4 @@ namespace ZL {
|
||||
int getHeight() const { return height; }
|
||||
};
|
||||
|
||||
} // namespace ZL
|
||||
} // namespace FRG
|
||||
@@ -117,7 +117,7 @@ PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArray = NULL;
|
||||
|
||||
#endif
|
||||
|
||||
namespace ZL {
|
||||
namespace FRG {
|
||||
|
||||
bool BindOpenGlFunctions()
|
||||
{
|
||||
|
||||
@@ -154,7 +154,7 @@ extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArray;
|
||||
#else
|
||||
|
||||
#endif
|
||||
namespace ZL {
|
||||
namespace FRG {
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "render/Renderer.h"
|
||||
#include <cmath>
|
||||
|
||||
namespace ZL {
|
||||
namespace FRG {
|
||||
|
||||
Matrix4f MakeOrthoMatrix(float width, float height, float zNear, float zFar)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "TextureManager.h"
|
||||
#include <Eigen/Dense>
|
||||
|
||||
namespace ZL {
|
||||
namespace FRG {
|
||||
|
||||
using Eigen::Vector2f;
|
||||
using Eigen::Vector3f;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <android/log.h>
|
||||
#endif
|
||||
|
||||
namespace ZL {
|
||||
namespace FRG {
|
||||
|
||||
ShaderResource::ShaderResource(const std::string &vertexCode, const std::string &fragmentCode) {
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "render/OpenGlExtensions.h"
|
||||
#include "utils/Utils.h"
|
||||
|
||||
namespace ZL {
|
||||
namespace FRG {
|
||||
|
||||
|
||||
constexpr size_t CONST_MAX_SHADER_STACK_SIZE = 16;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
|
||||
namespace ZL {
|
||||
namespace FRG {
|
||||
|
||||
// Build a look-at view matrix (column-major, same convention as the engine).
|
||||
static Eigen::Matrix4f lookAt(const Eigen::Vector3f& eye,
|
||||
@@ -167,4 +167,4 @@ namespace ZL {
|
||||
glViewport(0, 0, Environment::width, Environment::height);
|
||||
}
|
||||
|
||||
} // namespace ZL
|
||||
} // namespace FRG
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "render/OpenGlExtensions.h"
|
||||
#include <Eigen/Dense>
|
||||
|
||||
namespace ZL {
|
||||
namespace FRG {
|
||||
|
||||
class ShadowMap {
|
||||
private:
|
||||
@@ -44,4 +44,4 @@ namespace ZL {
|
||||
const Eigen::Vector3f& getLightDirection() const { return lightDirection; }
|
||||
};
|
||||
|
||||
} // namespace ZL
|
||||
} // namespace FRG
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <cmath>
|
||||
#include <unordered_set>
|
||||
|
||||
namespace ZL {
|
||||
namespace FRG {
|
||||
|
||||
struct GlyphAtlasData {
|
||||
std::unordered_map<uint32_t, GlyphInfo> glyphs;
|
||||
@@ -71,13 +71,13 @@ bool TextRenderer::init(Renderer& renderer, const std::string& ttfPath, int pixe
|
||||
#endif
|
||||
|
||||
}
|
||||
ZL::CheckGlError(__FILE__, __LINE__);
|
||||
FRG::CheckGlError(__FILE__, __LINE__);
|
||||
if (!loadGlyphs(ttfPath, pixelSize, zipfilename)) return false;
|
||||
ZL::CheckGlError(__FILE__, __LINE__);
|
||||
FRG::CheckGlError(__FILE__, __LINE__);
|
||||
|
||||
textMesh.data.PositionData.resize(6, Eigen::Vector3f(0, 0, 0));
|
||||
textMesh.RefreshVBO();
|
||||
ZL::CheckGlError(__FILE__, __LINE__);
|
||||
FRG::CheckGlError(__FILE__, __LINE__);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -515,4 +515,4 @@ void TextRenderer::drawText(const std::string& text, float x, float y, float sca
|
||||
// Сброс бинда текстуры не обязателен, но можно для чистоты
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
} // namespace ZL
|
||||
} // namespace FRG
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <array>
|
||||
|
||||
|
||||
namespace ZL {
|
||||
namespace FRG {
|
||||
|
||||
struct GlyphInfo {
|
||||
Eigen::Vector2f uv; // u,v координата левого верхнего угла в атласе (0..1)
|
||||
@@ -62,4 +62,4 @@ private:
|
||||
std::unordered_map<std::string, CachedText> cache;
|
||||
};
|
||||
|
||||
} // namespace ZL
|
||||
} // namespace FRG
|
||||
@@ -5,7 +5,7 @@
|
||||
#endif
|
||||
#include <iostream>
|
||||
|
||||
namespace ZL
|
||||
namespace FRG
|
||||
{
|
||||
#ifdef EMSCRIPTEN
|
||||
using std::min;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#define PNG_ENABLED
|
||||
#endif
|
||||
|
||||
namespace ZL
|
||||
namespace FRG
|
||||
{
|
||||
|
||||
struct TextureDataStruct {
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
#include "UiManager.h"
|
||||
#include <Eigen/Core>
|
||||
|
||||
namespace ZL
|
||||
namespace FRG
|
||||
{
|
||||
// Axis-aligned textured quad with cached mesh. Rebuild only when rect changes.
|
||||
struct UiQuad {
|
||||
|
||||
Reference in new issue
Block a user