Skip to content

Commit fe35448

Browse files
committed
Revert "add different implemenataion"
This reverts commit 9e113c0.
1 parent 9e113c0 commit fe35448

File tree

4 files changed

+1
-54
lines changed

4 files changed

+1
-54
lines changed

include/Util/Image.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,7 @@ class Image : public Core::Drawable {
6767

6868
static std::unique_ptr<Core::Program> s_Program;
6969
static std::unique_ptr<Core::VertexArray> s_VertexArray;
70-
71-
// See
72-
// https://github.com/ntut-open-source-club/practical-tools-for-simple-design/pull/162
73-
// Some OpenGL implementations may result in drastically different
74-
// performances
75-
#ifndef __APPLE__
76-
static std::unique_ptr<Core::UniformBuffer<Core::Matrices>> m_UniformBuffer;
77-
#else
7870
std::unique_ptr<Core::UniformBuffer<Core::Matrices>> m_UniformBuffer;
79-
#endif
8071

8172
static Util::AssetStore<std::shared_ptr<SDL_Surface>> s_Store;
8273

include/Util/Text.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,7 @@ class Text : public Core::Drawable {
7272

7373
static std::unique_ptr<Core::Program> s_Program;
7474
static std::unique_ptr<Core::VertexArray> s_VertexArray;
75-
76-
// See
77-
// https://github.com/ntut-open-source-club/practical-tools-for-simple-design/pull/162
78-
// Some OpenGL implementations may result in drastically different
79-
// performances
80-
#ifndef __APPLE__
81-
static std::unique_ptr<Core::UniformBuffer<Core::Matrices>> m_UniformBuffer;
82-
#else
8375
std::unique_ptr<Core::UniformBuffer<Core::Matrices>> m_UniformBuffer;
84-
#endif
8576

8677
// loads resources using `TTF_OpenFontRW`
8778
static Util::AssetStore<std::shared_ptr<SDL_RWops>> s_Store;

src/Util/Image.cpp

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,9 @@ Image::Image(const std::string &filepath)
3232
if (s_VertexArray == nullptr) {
3333
InitVertexArray();
3434
}
35-
#ifndef __APPLE__
36-
if (m_UniformBuffer == nullptr) {
37-
InitUniformBuffer();
38-
}
39-
#else
35+
4036
m_UniformBuffer = std::make_unique<Core::UniformBuffer<Core::Matrices>>(
4137
*s_Program, "Matrices", 0);
42-
#endif
4338

4439
auto surface = s_Store.Get(filepath);
4540

@@ -115,20 +110,8 @@ void Image::InitVertexArray() {
115110
// NOLINTEND
116111
}
117112

118-
#ifndef __APPLE__
119-
void Image::InitUniformBuffer() {
120-
m_UniformBuffer = std::make_unique<Core::UniformBuffer<Core::Matrices>>(
121-
*s_Program, "Matrices", 0);
122-
}
123-
#endif
124-
125113
std::unique_ptr<Core::Program> Image::s_Program = nullptr;
126114
std::unique_ptr<Core::VertexArray> Image::s_VertexArray = nullptr;
127115

128-
#ifndef __APPLE__
129-
std::unique_ptr<Core::UniformBuffer<Core::Matrices>> Image::m_UniformBuffer =
130-
nullptr;
131-
#endif
132-
133116
Util::AssetStore<std::shared_ptr<SDL_Surface>> Image::s_Store(LoadSurface);
134117
} // namespace Util

src/Util/Text.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,8 @@ Text::Text(const std::string &font, int fontSize, const std::string &text,
3333
InitVertexArray();
3434
}
3535

36-
#ifndef __APPLE__
37-
if (m_UniformBuffer == nullptr) {
38-
InitUniformBuffer();
39-
}
40-
#else
4136
m_UniformBuffer = std::make_unique<Core::UniformBuffer<Core::Matrices>>(
4237
*s_Program, "Matrices", 0);
43-
#endif
4438

4539
m_Font = {TTF_OpenFontRW(s_Store.Get(font).get(), 0, fontSize),
4640
TTF_CloseFont};
@@ -138,20 +132,8 @@ void Text::ApplyTexture() {
138132
m_Size = {surface->pitch / surface->format->BytesPerPixel, surface->h};
139133
}
140134

141-
#ifndef __APPLE__
142-
void Text::InitUniformBuffer() {
143-
m_UniformBuffer = std::make_unique<Core::UniformBuffer<Core::Matrices>>(
144-
*s_Program, "Matrices", 0);
145-
}
146-
#endif
147-
148135
std::unique_ptr<Core::Program> Text::s_Program = nullptr;
149136
std::unique_ptr<Core::VertexArray> Text::s_VertexArray = nullptr;
150137

151-
#ifndef __APPLE__
152-
std::unique_ptr<Core::UniformBuffer<Core::Matrices>> Text::m_UniformBuffer =
153-
nullptr;
154-
#endif
155-
156138
Util::AssetStore<std::shared_ptr<SDL_RWops>> Text::s_Store(LoadFontFile);
157139
} // namespace Util

0 commit comments

Comments
 (0)