Skip to content

Commit 350fc5e

Browse files
committed
Fixed shader array initialization syntax which didn't work on my MacOS computer for some reason?
1 parent 4e461f5 commit 350fc5e

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

FallingGame/Layer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void APIENTRY glDebugOutput(GLenum source,
6161
void Layer::init()
6262
{
6363
if (SDL_Init(SDL_INIT_VIDEO) < 0) printf("SDL could not initialize! SDL_Error: %s\n", SDL_GetError());
64-
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
64+
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
6565
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
6666
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
6767
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
@@ -88,7 +88,7 @@ void Layer::init()
8888
std::cin.get();
8989
}
9090

91-
{
91+
if constexpr (false) {
9292
int flags; glGetIntegerv(GL_CONTEXT_FLAGS, &flags);
9393
if (flags & GL_CONTEXT_FLAG_DEBUG_BIT)
9494
{

FallingGame/f/shaders/bird.vert

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ out vec2 f_screenCoord;
66
uniform vec2 u_offset;
77
uniform vec3 u_rotation_width_height;
88

9-
vec2 poses[4] = {
9+
vec2 poses[4] = vec2[4](
1010
vec2(-0.5f,-0.5f),
1111
vec2(-0.5f,0.5f),
1212
vec2(0.5f,0.5f),
1313
vec2(0.5f,-0.5f)
14-
};
14+
);
1515

16-
vec2 texCoords[4] = {
16+
vec2 texCoords[4] = vec2[4](
1717
vec2(1.f,1.f),
1818
vec2(1.f,0.f),
1919
vec2(0.f,0.f),
2020
vec2(0.f,1.f)
21-
};
21+
);
2222

2323
void main()
2424
{

FallingGame/f/shaders/cloud.vert

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ out vec2 f_screenCoord;
77
out float f_texture;
88
out float f_z;
99

10-
vec2 texPos[4] = {
11-
{0.f, 1.f},
12-
{0.f, 0.f},
13-
{1.f, 0.f},
14-
{1.f, 1.f},
15-
};
10+
vec2 texPos[4] = vec2[4](
11+
vec2(0.f, 1.f),
12+
vec2(0.f, 0.f),
13+
vec2(1.f, 0.f),
14+
vec2(1.f, 1.f)
15+
);
1616

1717
void main()
1818
{

FallingGame/misc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
constexpr inline bool DRAW_HB = true; // draw hitboxes?s
3+
constexpr inline bool DRAW_HB = false; // draw hitboxes?s
44
// R for hot reload.
55
constexpr inline bool DEV_TOOLS = true; // allow development stuff
66

0 commit comments

Comments
 (0)