Displaying a Viewport over 2D

Blitz3D Forums/Blitz3D Programming/Displaying a Viewport over 2D

Black Hydra(Posted 2005) [#1]
I've been using BlitzUI for an editor for my game.

Since the game is 3D, I need to display 3D stuff in the editor.

Now I'm trying to render some viewports for the different views (side and top).

Unfortunately the viewport commands with renderworld are causing horrible flickers on the screen. I'm guessing its because there is two 'flip' calls being made.

So now what I am trying to do is to copy the rendered world over to two images via CopyRect and then draw the images.

This is not working either. When I remove the renderworld calls the buffers display the red rectangle I draw. If I put the renderworld call in, however, nothing gets displayed. It isn't a black void, its completely transparent. So I'm guessing I'm doing something wrong with the whole way renderworld works.

Perhaps you could steer me into the right direction?



Thanks for reading my post!


big10p(Posted 2005) [#2]
Look up the CameraViewport command in the online help. :)


Black Hydra(Posted 2005) [#3]
Yeah, I mentioned that I tried using the viewport commands but it caused irritating flickering. This is probably due to the whole call to renderworld then flip.


jfk EO-11110(Posted 2005) [#4]
Viewport and CameraViewport is not the same.

Are you using Fullscreen or Windowed Mode?

Try to
setbuffer backbuffer()
Renderworld
draw all 2d stuff including gui etc.
flip (only once)

maybe you should try to use the hardware sync to flip, something like:

vwait: flip false


Black Hydra(Posted 2005) [#5]
Yes, I meant CameraViewport.

The problem with rendering the viewport before the 2D gui is that it would draw overtop the viewports...

I'll try drawing it afterwards but before any flips. It will mean I'll have to edit BlitzUI's source code, but... ah well.