Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

hello_there

screens

This topic is 5490 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Well you can create 4 real windows, but probably you want something like 3DSmax, with four different views in the same window ?
If it''s what you want, you can draw your scene with different view angles (top, left etc ...) in as many viewports as you want.

glViewPort(MyTopView);
DrawtopScene();

glViewPort(MyLeftView);
DrawLeftScene();

...

Share this post


Link to post
Share on other sites
This is my wndproc function how would i change it so it would have 4 windows on the screen. or would you have to change something else as well?

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static HGLRC hRC;
static HDC hDC;
int width,height;

switch(message)
{

case WM_CREATE: // window is being created

hDC = GetDC(hwnd);
g_hdc = hDC;
setuppixelformat(hDC);

hRC = wglCreateContext(hDC);
wglMakeCurrent(hDC,hRC);

return 0;
break;

case WM_CLOSE: // windows is closing

wglMakeCurrent(hDC,NULL);
wglDeleteContext(hRC);

PostQuitMessage(0);
return 0;
break;

case WM_SIZE:

height = HIWORD(lParam);
width = LOWORD(lParam);

if(height == 0)
{
height = 1;
}

glViewport(0,0,width,height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();

gluPerspective(54.0f,(GLfloat)width/(GLfloat)height,0.1f,1000.0f);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

return 0;
break;

default:
break;
}

return (DefWindowProc(hwnd, message, wParam, lParam));
}

Share this post


Link to post
Share on other sites
If you want 4 windows (and not 4 viewPorts in one window), i can''t help you, since i always need only one window. I''m not really good with windows programming, but may be you ll have to create a parent window and 3 childs, nothing to do with your WndProc, but i let more competent people explain you that in details .

Share this post


Link to post
Share on other sites
i want it like 3d studio max 5''s thing but i only know limited windows programming. i don''t want it as advanced as that just a full screen programe with for viewing windows like top left etc. i know you can put different numbers in the glViewport(); funstion to move the viewport but how do you make 4 of them?

Share this post


Link to post
Share on other sites
In this case (one window with four viewports) you can do just like i said before : in your drawing routine, call glViewport with the correct parameters as many time as you want.

void MyDrawingFunction()
{
glViewport(viewport settings 1)
DrawScene1()

glViewport(viewport settings 2)
DrawScene2()

etc..
}

My english is not really good, may be it''s not clear ?

Share this post


Link to post
Share on other sites

Sorry but i really don''t understand what you really want and what you are doing ...

If you have only one window with four viewports, then what''s the problem with your mouse ? One window, one WndProc (and one mouse ) , all is ok ...

If you have four windows, then you should have 4 WndProc, one for each window, or only one WndProc but with a switch statement inside with one case per window. But again, i''m not really good at windows programming ...

Share this post


Link to post
Share on other sites
if you want to create a 4 window splitt screen like most editors have it
then search the articles section toolsprogramming
for Creating 3D tools with MFC

nice and easy tutorial and btw MFC is really easy
you just need to get use to their message map concepts

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!