HI, im new to mac development and am having a really hard time figuring it out. Right now im trying to use 3 sliders for RGB to select the color of an OpenGLView.
I attached my source code, well i think.
But here is my problem :
I really just guessing on this one but R & G are floats and used here :
I do not know how to get the NSSlider's value into my RGB variables. this whole drawing lines to develop relationships is really confusing but looks vary promising.
PS : Im coming from VB and C++ development, please use them to explain any references.
I attached my source code, well i think.
But here is my problem :
Code:
- (IBAction) setRed: (id) sender {
R = (float)[redSlider value];
}
- (IBAction) setGreen: (id) sender {
G = [sender value];
}
I really just guessing on this one but R & G are floats and used here :
Code:
- (void) drawRect: (NSRect) rect {
glViewport(0, 0, (GLsizei) rect.size.width, (GLsizei) rect.size.height);
glClearColor(R, G, B, 1.0f);
printf("%i, %i, %i \n", R, G, B);
glClear(GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT + GL_STENCIL_BUFFER_BIT);
[[self openGLContext] flushBuffer];
}
I do not know how to get the NSSlider's value into my RGB variables. this whole drawing lines to develop relationships is really confusing but looks vary promising.
PS : Im coming from VB and C++ development, please use them to explain any references.