aboutsummaryrefslogtreecommitdiffstats
path: root/yage
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-11-17 23:13:42 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-11-17 23:13:42 +0000
commit186279ee1ee54f2cdf619f4740679bb0d8b74db4 (patch)
treeb8798b8e571e4a05e84469cd1f815a6ec3e8bafe /yage
parentfbbfad54d6281c2e08aeb2ac51c68cb7ba293f7e (diff)
downloadYAGE-186279ee1ee54f2cdf619f4740679bb0d8b74db4.tar.gz
YAGE-186279ee1ee54f2cdf619f4740679bb0d8b74db4.zip
Renaming color to colour
Diffstat (limited to 'yage')
-rw-r--r--yage/core/sprite.cpp8
-rw-r--r--yage/core/spritebatch.cpp12
-rw-r--r--yage/core/spritebatch.h2
-rw-r--r--yage/core/vertex.h22
-rw-r--r--yage/core/window.cpp10
5 files changed, 27 insertions, 27 deletions
diff --git a/yage/core/sprite.cpp b/yage/core/sprite.cpp
index 246d415d..041281d3 100644
--- a/yage/core/sprite.cpp
+++ b/yage/core/sprite.cpp
@@ -56,11 +56,11 @@ void Sprite::init(float x, float y, float width, float height,
vertex_data[5].setUv(1.f, 0.f);
for (auto &i : vertex_data) {
- i.setColor(255, 0, 255, 255);
+ i.setColour(255, 0, 255, 255);
}
- vertex_data[1].setColor(0, 255, 255, 255);
- vertex_data[4].setColor(255, 0, 0, 255);
+ vertex_data[1].setColour(0, 255, 255, 255);
+ vertex_data[4].setColour(255, 0, 0, 255);
glBindBuffer(GL_ARRAY_BUFFER, vbo_id_);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data,
@@ -80,7 +80,7 @@ void Sprite::draw()
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex),
(void *)offsetof(Vertex, position));
glVertexAttribPointer(1, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Vertex),
- (void *)offsetof(Vertex, color));
+ (void *)offsetof(Vertex, colour));
glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex),
(void *)offsetof(Vertex, uv));
glDrawArrays(GL_TRIANGLES, 0, 6);
diff --git a/yage/core/spritebatch.cpp b/yage/core/spritebatch.cpp
index 6eac7f09..00673c08 100644
--- a/yage/core/spritebatch.cpp
+++ b/yage/core/spritebatch.cpp
@@ -63,26 +63,26 @@ void SpriteBatch::end()
void SpriteBatch::draw(const yage::Vector4f &destination_rect,
const yage::Vector4f &uv_rect, GLuint texture,
- const Color &color, float depth)
+ const Colour &colour, float depth)
{
Vertex top_left, top_right, bottom_right, bottom_left;
- top_left.color = color;
+ top_left.colour = colour;
top_left.setPosition(destination_rect.x,
destination_rect.y + destination_rect.w);
top_left.setUv(uv_rect.x, uv_rect.y + uv_rect.w);
- top_right.color = color;
+ top_right.colour = colour;
top_right.setPosition(destination_rect.x + destination_rect.z,
destination_rect.y + destination_rect.w);
top_right.setUv(uv_rect.x + uv_rect.z, uv_rect.y + uv_rect.w);
- bottom_right.color = color;
+ bottom_right.colour = colour;
bottom_right.setPosition(destination_rect.x + destination_rect.z,
destination_rect.y);
bottom_right.setUv(uv_rect.x + uv_rect.z, uv_rect.y);
- bottom_left.color = color;
+ bottom_left.colour = colour;
bottom_left.setPosition(destination_rect.x, destination_rect.y);
bottom_left.setUv(uv_rect.x, uv_rect.y);
@@ -131,7 +131,7 @@ void SpriteBatch::createVertexArray()
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex),
(void *)offsetof(Vertex, position));
glVertexAttribPointer(1, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(Vertex),
- (void *)offsetof(Vertex, color));
+ (void *)offsetof(Vertex, colour));
glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex),
(void *)offsetof(Vertex, uv));
glDrawArrays(GL_TRIANGLES, 0, 6);
diff --git a/yage/core/spritebatch.h b/yage/core/spritebatch.h
index e0b612a4..9ec7cffb 100644
--- a/yage/core/spritebatch.h
+++ b/yage/core/spritebatch.h
@@ -95,7 +95,7 @@ public:
// adds a sprite to the sprite batch to be rendered later
void draw(const yage::Vector4f &destination_rect,
- const yage::Vector4f &uv_rect, GLuint texture, const Color &color,
+ const yage::Vector4f &uv_rect, GLuint texture, const Colour &colour,
float depth);
// render the batch
void render();
diff --git a/yage/core/vertex.h b/yage/core/vertex.h
index 270a6825..da3c2bfa 100644
--- a/yage/core/vertex.h
+++ b/yage/core/vertex.h
@@ -23,15 +23,15 @@ struct Position {
Position(float x_, float y_) : x(x_), y(y_) {}
};
-struct Color {
+struct Colour {
GLubyte r;
GLubyte g;
GLubyte b;
GLubyte a;
- Color() = default;
+ Colour() = default;
- Color(GLubyte r_, GLubyte g_, GLubyte b_, GLubyte a_)
+ Colour(GLubyte r_, GLubyte g_, GLubyte b_, GLubyte a_)
: r(r_), g(g_), b(b_), a(a_)
{
}
@@ -48,13 +48,13 @@ struct UV {
struct Vertex {
Position position;
- Color color;
+ Colour colour;
UV uv;
Vertex() = default;
- Vertex(const Position &position_, const Color &color_, const UV &uv_)
- : position(position_), color(color_), uv(uv_)
+ Vertex(const Position &position_, const Colour &colour_, const UV &uv_)
+ : position(position_), colour(colour_), uv(uv_)
{
}
@@ -64,12 +64,12 @@ struct Vertex {
position.y = y;
}
- void setColor(GLubyte r, GLubyte g, GLubyte b, GLubyte a)
+ void setColour(GLubyte r, GLubyte g, GLubyte b, GLubyte a)
{
- color.r = r;
- color.g = g;
- color.b = b;
- color.a = a;
+ colour.r = r;
+ colour.g = g;
+ colour.b = b;
+ colour.a = a;
}
void setUv(float u, float v)
diff --git a/yage/core/window.cpp b/yage/core/window.cpp
index 94e9f763..f9246ea2 100644
--- a/yage/core/window.cpp
+++ b/yage/core/window.cpp
@@ -17,9 +17,9 @@ void key_callback(GLFWwindow *window, int key, int scanCode, int action,
int mods)
{
if (key == GLFW_KEY_E && action == GLFW_PRESS) {
- glClearColor(0.5f, 0.f, 0.f, 1.f);
+ glClearColour(0.5f, 0.f, 0.f, 1.f);
} else {
- glClearColor(0.f, 0.5f, 0.f, 1.f);
+ glClearColour(0.f, 0.5f, 0.f, 1.f);
}
}
@@ -58,8 +58,8 @@ void Window::create(std::string window_name, int width, int height)
// set vsync on
glfwSwapInterval(1);
- // set the clear color to black
- glClearColor(0.f, 0.5f, 0.f, 1.f);
+ // set the clear colour to black
+ glClearColour(0.f, 0.5f, 0.f, 1.f);
// set alpha blending
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -75,7 +75,7 @@ void Window::swapBuffer()
void Window::clearBuffer()
{
- // clears buffer with clear color
+ // clears buffer with clear colour
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}