okay, so to show my total lack of knowledge of either subject, i have what i think is a really simple question that has me somewhat befuddled.
i’m taking the opengl demo app and adding a simple function to do alpha testing. i want to add a slider that controls my alpha test value (for those curious, alpha testing is a way to discard fragments based on an alpha threshhold test – useful for depth buffer sanity with alpha textures like the “juce box”).
so here’s the problem. opengl doesn’t mix well with juce. so i’m adding a slider component to the OpenGLDemo class instead of the DemoOpenGLCanvas class. works fine, draws appropriately, etc. the problem is, how do i get its value?
is this my lack of c++ knowledge (i’m a c programmer) or my lack of juce knowledge that’s the problem? in my renderOpenGL function, i would love to simply call a getValue() for my alphaSlider, but the alphaSlider is unknown to the DemoOpenGLCanvas class. it’s a member of the “parent” object, so it would seem that there’s gotta be a simple way to reference up one level or something… but that’s where my lack of c++ gets me.
i thought about going the route of listeners and such, but the same problem exists – no ability to reference alphaSlider from the DemoOpenGLCanvas class…
what am i doing wrong?