Browse Source

remove GlTexture

feature/replace-renderer
Martin Dørum 3 years ago
parent
commit
f971f448c8
2 changed files with 0 additions and 34 deletions
  1. 0
    16
      libcygnet/include/cygnet/GlWrappers.h
  2. 0
    18
      libcygnet/src/GlWrappers.cc

+ 0
- 16
libcygnet/include/cygnet/GlWrappers.h View File

@@ -59,20 +59,4 @@ private:
GLuint id_;
};

class GlTexture {
public:
GlTexture();

void upload(GLsizei width, GLsizei height, void *data,
GLenum format, GLenum type);
GLuint id() { return id_; }
int width() { return w_; }
int height() { return h_; }

private:
GLuint id_;
int w_;
int h_;
};

}

+ 0
- 18
libcygnet/src/GlWrappers.cc View File

@@ -93,22 +93,4 @@ void GlProgram::link() {
}
}

GlTexture::GlTexture() {
glGenTextures(1, &id_);
glCheck();
}

void GlTexture::upload(GLsizei width, GLsizei height, void *data,
GLenum format, GLenum type) {
w_ = width;
h_ = height;
glBindTexture(GL_TEXTURE_2D, id_);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, format, type, data);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glCheck();
}

}

Loading…
Cancel
Save