oh…I just noticed that code also was using pbuffers. I was hoping to not using pbuffer since some of the project machines keep getting these pixel format exceptions when using pbuffers. What I need is a 800x600 screenshot of a variable size canvas…
You don’t need to use a pbuffer with the TileRenderer. It can read its results from the back buffer so they don’t need to be displayed on-screen. Try changing the test case to use an on-screen GLCanvas.
Really? I did not know that. Any idea how to use/save the backbuffer without displaying it then? Or am I way off here…
I think this might be the solution I have been looking for for a couple of months now if I can just get it working
Look at the man pages for glReadBuffer and glReadPixels.
Hmm…is there any standard “this is what your doing wrong” if I get the following output using TileRenderer?
http://home.online.no/~bj-bakke/test.png
Its suppose to render one large triangle.
The code is as usual over at http://home.online.no/~bj-bakke/hello.java
If I can just get this one working I am as good as done with my project
UPDATE: It works if I run my app in fullscreen. That means if the tilesize is bigger than the image size. If not then I get this weird image.
You definitely need to call trPerspective in order to tell the library what the overall view frustum is that you’re rendering into. You should also make sure that your rendering routine “disp” produces exactly the same results no matter when you call it in the beginTile / endTile loop. I think you are also not supposed to modify the projection matrix in your rendering routine. You may also want to simply set a boolean flag when the capture key is pressed and do the capturing work in your display() routine instead of doing manual context manipulation. Beyond that I would recommend you just study the TiledRendering demo.
I tried that without any different results. Perhaps I am doing it wrong.
[quote]You should also make sure that your rendering routine “disp” produces exactly the same results no matter when you call it in the beginTile / endTile loop.
[/quote]
Do you mean the rot += thingy? That is way gone but it didnt matter for the result. was mostly for the animator.
[quote]I think you are also not supposed to modify the projection matrix in your rendering routine.
[/quote]
Where do I do that? Perhaps I dont get what you mean…
[quote]Beyond that I would recommend you just study the TiledRendering demo.
[/quote]
I did…I even tried swapping the drawGears function with my triangle, but then I got the same result. I really dont get what going on.
I managed to get the TiledRendering demo to work with my triangle just as I wanted it so I guess I perhaps will get it working on the canvas also soon. Thanks for the help so far