openframeworks / openframeworks/openFrameworks

ofTexture line 914 glActiveTexture(GL_TEXTURE0); -catch exception

Open
#3,463 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug core section-2D
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

// make sure we are on unit 0 - we may change this when setting shader samplers
// before glEnable or else the shader gets confused
/// ps: maybe if bUsingArbTex is enabled we should use glActiveTextureARB?
glActiveTexture(GL_TEXTURE0);

This happens both with GLUT and GLFW,

in some machines the moment you draw an Image/texture, it gives an exception

it has been mentioned many times.

REASON:
GL_TEXTURE0 was not introduced until openGL 1.3 so when called directly on machines without that it throws an exeption,

If I remove it, and run an empty openframeworks example with just an ofImage::draw()

it compiles and runs smoothly even with GLFW under 1.1 (but of-course it doesn't draw the texture)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the line 914 glActiveTexture(GL_TEXTURE0) call and compare behavior when using GLUT or GLFW with an OpenGL 1.1 context. Reproduce the exception by drawing an ofImage, then verify that the chosen compatibility behavior avoids the exception while preserving texture drawing where supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.