| 6261 | } |
| 6262 | |
| 6263 | uint32_t CreateTexture(const uint32_t width, const uint32_t height, const bool filtered, const bool clamp) override |
| 6264 | { |
| 6265 | UNUSED(width); |
| 6266 | UNUSED(height); |
| 6267 | uint32_t id = 0; |
| 6268 | glGenTextures(1, &id); |
| 6269 | glBindTexture(GL_TEXTURE_2D, id); |
| 6270 | |
| 6271 | if (filtered) |
| 6272 | { |
| 6273 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
| 6274 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
| 6275 | } |
| 6276 | else |
| 6277 | { |
| 6278 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
| 6279 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); |
| 6280 | } |
| 6281 | |
| 6282 | if (clamp) |
| 6283 | { |
| 6284 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); |
| 6285 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); |
| 6286 | } |
| 6287 | else |
| 6288 | { |
| 6289 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); |
| 6290 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); |
| 6291 | } |
| 6292 | #if !defined(OLC_PLATFORM_EMSCRIPTEN) |
| 6293 | glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); |
| 6294 | #endif |
| 6295 | return id; |
| 6296 | } |
| 6297 | |
| 6298 | uint32_t DeleteTexture(const uint32_t id) override |
| 6299 | { |
nothing calls this directly
no outgoing calls
no test coverage detected