Skip to content

Commit 58074a1

Browse files
committed
Fix compilation errors
1 parent 62ba5de commit 58074a1

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/camera.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "camera.h"
55

6-
Camera::Camera(float aspectRatio) { Camera::aspectRatio = aspectRatio; }
6+
Camera::Camera(float aspect) { Camera::aspectRatio = aspect; }
77

88
void Camera::moveForward(float amount) { pos += front * amount; }
99

src/camera.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Camera {
2020

2121
float aspectRatio;
2222

23-
Camera(float aspectRatio);
23+
Camera(float aspect);
2424

2525
void moveForward(float amount);
2626
void moveSideways(float amount);

src/texture.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
#include "texture.h"
99

10-
Texture::Texture(const std::string &path, unsigned int filter,
11-
unsigned int wrap) {
10+
Texture::Texture(const std::string &path, GLint filter, GLint wrap) {
1211
// create a texture object
1312
glGenTextures(1, &ID);
1413
glBindTexture(GL_TEXTURE_2D, ID);
@@ -40,7 +39,7 @@ Texture::Texture(const std::string &path, unsigned int filter,
4039
<< " channels which is unhandled case!" << std::endl;
4140
}
4241
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
43-
glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format,
42+
glTexImage2D(GL_TEXTURE_2D, 0, (GLint)format, width, height, 0, format,
4443
GL_UNSIGNED_BYTE, data);
4544
glGenerateMipmap(GL_TEXTURE_2D);
4645
} else {

src/texture.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#ifndef TEXTURE_H
22
#define TEXTURE_H
33

4+
#include <GL/glew.h>
45
#include <fstream>
56

67
class Texture {
78
public:
89
unsigned int ID;
910
int width, height, nrChannels;
1011

11-
Texture(const std::string &path, unsigned int filter, unsigned int wrap);
12+
Texture(const std::string &path, GLint filter, GLint wrap);
1213
void use(unsigned int texture_id);
1314
};
1415

0 commit comments

Comments
 (0)