Skip to main content
GameDev.net gamedev.net
🔒 Locked

Multiple viewports

Started by TeSsL Apr 1, 2009 at 11:28 AM 2 replies 900+ views
Original Post
TeSsL
TeSsL
Hihi~ have got a few questions regarding viewports and canvas.. 1. Is it feasible to have 2 canvas in a frame? I tried doing so but somehow the 2nd canvas just repeat what was on my main canvas. and if i link the 2nd canvas to a different renderer, it only shows a white screen. 2. Is using different viewports similar to that of using multiple canvas? Does a smaller viewport at the bottom of my frame affect my coordinates system? 3. I am trying to create a smaller panel inside my frame whereby i can place my components such as buttons, txtbox.. Also to place some zoom in versions of my main scene(something like games with a smaller map showing the current position of the player). What is the more appropriate way of doing it? Thanks for any help.
killer_danish
killer_danish
1. I am not sure what you mean by canvas. The white screen seems like a problem with clearing the screen try glClear(BUFFERS YOU WANT TO CLEAR GO HERE), followed by a color to clear to.

2. I'm sorry but again what's canvas?

3. That depends on where in your frame you want the panel to be in your frame. For example if panel is to be on the bottom of the frame then glViewPort(0.0, x_size_of_pixels+1, 0.0, y_size_of_pixels-(however_many_pixels_the_size_of_your_buttons_are)).

Well I hope I was helpful.
scarypajamas
scarypajamas
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=42

killer_danish, I believe when TeSsL is talking about the "canvas" he is referring to the Opengl Drawing Canvas.
TeSsL
TeSsL
ya. i was refering to the drawing canvas.
[SOLVED] Thx thx

[Edited by - TeSsL on April 1, 2009 8:49:17 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.