You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
401 B
15 lines
401 B
3 years ago
|
#include "common/visionimg.h"
|
||
4 years ago
|
|
||
5 years ago
|
#include <cassert>
|
||
|
|
||
4 years ago
|
EGLImageTexture::EGLImageTexture(const VisionBuf *buf) {
|
||
|
glGenTextures(1, &frame_tex);
|
||
|
glBindTexture(GL_TEXTURE_2D, frame_tex);
|
||
4 years ago
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, buf->width, buf->height, 0, GL_RGB, GL_UNSIGNED_BYTE, nullptr);
|
||
4 years ago
|
glGenerateMipmap(GL_TEXTURE_2D);
|
||
|
}
|
||
|
|
||
4 years ago
|
EGLImageTexture::~EGLImageTexture() {
|
||
|
glDeleteTextures(1, &frame_tex);
|
||
4 years ago
|
}
|