You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// OpenGL uses a double buffer (front and back buffers) technique for rendering
291
-
// All of the rendering commands will go to back buffer
292
-
// After all of the rendering commands are done we switch to the front buffer which has the final output image
293
-
// If we don't do this we can see flickering in output image, cause the image is build pixel by pixel from left to right and from top to bottom
294
-
// So basically we'll see the image being build and that's why will see the flickering (if image is small and not complex than it probably won't matter)
* @brief Class Texture to handle texture operations such as - loading, using and clearing textures.
15
+
*/
16
+
classTexture
17
+
{
18
+
private:
19
+
GLuint textureId; // ID to reference texture
20
+
GLenum target; // Defines the type of texture (1D/2D/3D), for some reason OpenGL is calling it "target" instead of "type".
21
+
GLenum wrappingParams; // Specifies how to wrap the texture on mesh
22
+
GLenum filterParams; // Specifies filter options for texture
23
+
int width, height, nrComponents; // Specifies the width, height and depth in space for texture
24
+
std::string path; // Path to texture file
25
+
unsignedint textureUnit; // Specifies which texture unit should this texture use (usually most computers will have a minimum of 16 units), starting from GL_TEXTURE0 - GL_TEXTURE[N]
26
+
27
+
public:
28
+
Texture();
29
+
Texture(GLuint textureId, GLenum target, GLenum wrappingParams, GLenum filterParams, int width, int height, std::string path, unsignedint textureUnit);
0 commit comments