Solution

Files changed (1) hide show
  1. lab2-textures/lab2_main.cpp +6 -4
lab2-textures/lab2_main.cpp CHANGED
@@ -92,10 +92,10 @@ void initialize()
92
92
  // Enable the vertex attrib array.
93
93
  ///////////////////////////////////////////////////////////////////////////
94
94
  float texcoords[] = {
95
- 0.0f, 0.0f, // (u,v) for v0
96
- 0.0f, 1.0f, // (u,v) for v1
97
- 1.0f, 1.0f, // (u,v) for v2
98
- 1.0f, 0.0f // (u,v) for v3
95
+ 0.0f, 0.0f, // (u,v) for v0
96
+ 0.0f, 15.0f, // (u,v) for v1
97
+ 1.0f, 15.0f, // (u,v) for v2
98
+ 1.0f, 0.0f // (u,v) for v3
99
99
  };
100
100
  // Create a handle for the vertex texture buffer
101
101
  glGenBuffers(1, &texcoordBuffer);
@@ -140,6 +140,8 @@ void initialize()
140
140
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
141
141
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
142
142
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
143
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
144
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
143
145
  glBindTexture(GL_TEXTURE_2D, 0);
144
146
 
145
147
  stbi_image_free(image);