Re: [racket-users] New eyes needed for opengl problem

2018-04-08 Thread David Vanderson
Phew! I was confused, but that makes total sense. Great! On Sun, Apr 8, 2018 at 2:34 PM, Jens Axel Søgaard wrote: > Hi David. > > Heureka! I think I figured it out. When load-texture defined in > opengl/utils loads an image > it automatically generates an mimap, which are smaller versions of t

Re: [racket-users] New eyes needed for opengl problem

2018-04-08 Thread Jens Axel Søgaard
Hi David. Heureka! I think I figured it out. When load-texture defined in opengl/utils loads an image it automatically generates an mimap, which are smaller versions of the same image. When I draw I am drawing on the full size image - so all I need to do is to generate a new mimap. (glGenerat

Re: [racket-users] New eyes needed for opengl problem

2018-04-08 Thread David Vanderson
Something weird is going on. If I make the viewport bigger when drawing to the screen then I see the blue triangle: ; switch to screen framebuffer (glBindFramebuffer GL_DRAW_FRAMEBUFFER 0) (glViewport 0 0 1000 1000) ; somehow this makes a difference? If I make the viewport exactly match the

Re: [racket-users] New eyes needed for opengl problem

2018-04-08 Thread Jens Axel Søgaard
Hi David, Thanks for the viewport suggestion. I have made a version below that sets the viewport. Saving the logo+triangle shows that the blue triangle has been drawn on the frame buffer. It disappears (?!) when I try to copy contents from the framebuffer to screen though. #lang racket/gui (requi

Re: [racket-users] New eyes needed for opengl problem

2018-04-07 Thread David Vanderson
I'm also learning, but I think in this case the viewport is not sized correctly to draw to the texture. I think you need something like this: ; Draw a blue triangle ***this is the part that isn't working*** (glDrawBuffer GL_COLOR_ATTACHMENT0) ; draw to color attachment 0 (glDisableGL