Pages: 1
  Print  
Author Topic: Problems with multiple views  (Read 1078 times)
Offline (Unknown gender) egofree
Posted on: May 19, 2014, 04:19:04 AM
Contributor
Joined: Jun 2013
Posts: 603

View Profile Email
Hello,

It is not possible to have multiple views visible at the same time : i've a room and i want to display two different views of this room. So far i didn't succeed to implement this in ENIGMA. In GM i've no problems. Any help is welcome.

Here is a simple test project :
https://dl.dropboxusercontent.com/u/29802501/test_view.egm

There is a room (640*960), with two views : view0 displays the upper part of the room and view1 the bottom, but we see only view1.

Update: i did more tests and i've found that this problem occurs only with OpenGL (1.1 and 3), with DirectX 9.0 it's ok !
« Last Edit: May 19, 2014, 08:11:35 AM by egofree » Logged
Offline (Male) Goombert
Reply #1 Posted on: May 19, 2014, 11:49:54 AM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
Probably something to do with not flipping the backbuffer, most likely an easy fix.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) egofree
Reply #2 Posted on: May 26, 2014, 02:05:01 PM
Contributor
Joined: Jun 2013
Posts: 603

View Profile Email
Probably something to do with not flipping the backbuffer, most likely an easy fix.

I know nothing about OpenGl, but anyway i tried to investigate the problem.  :D I read that when you are using multiple viewports with OpenGL, you should use the instruction SwapBuffers(). So i tried in the GL3screen.cpp file, to add this method in the screen_redraw() function :


Code: [Select]
    for (view_current = 0; view_current < 8; view_current++)
    {
        ...

        screen_set_viewport(view_xport[vc], view_yport[vc], view_wport[vc], view_hport[vc]);

        clear_view(view_xview[vc], view_yview[vc], view_wview[vc], view_hview[vc], view_angle[vc], background_showcolor && draw_backs);

        ...

        SwapBuffers();
    }

I try to use this method, but i've a message which declares it's not available. ('SwapBuffers' was not declared in this scope). I know it's a noob question, but if someone can help, i will appreciate.

Edit : it seems SwapBuffers is not included in glew.h, but it's available in glew.c, so i tried to include this file also, but it was a mistake as ENIGMA is stuck when compiling the sources. (c.f glew manual : 'The simpler but less flexible way is to include glew.h and glew.c into your project')
« Last Edit: May 26, 2014, 02:31:43 PM by egofree » Logged
Offline (Unknown gender) Darkstar2
Reply #3 Posted on: May 26, 2014, 02:23:50 PM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
Aren't you supposed to use glFinish(); before Swapbuffers ?
Logged
Offline (Unknown gender) egofree
Reply #4 Posted on: May 26, 2014, 02:39:13 PM
Contributor
Joined: Jun 2013
Posts: 603

View Profile Email
Aren't you supposed to use glFinish(); before Swapbuffers ?

In the examples i've found on internet, it didn't seem mandatory. But anyway the problem is that i don't know how to include the Swapbuffers method. With the latest glew version, you've  the Swapbuffers defined in glxew.h and wglew.h headers, which are platform specific extensions, but we don't have these files in ENIGMA,.
Logged
Offline (Male) Goombert
Reply #5 Posted on: May 26, 2014, 05:17:52 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
egofree, we call swap buffers in screen_refresh, which I believe is defined in bridges. Anyway, yes that is exactly what I said the problem was.

Quote from: RobertBColton
Probably something to do with not flipping the backbuffer, most likely an easy fix.
By that I meant, of course, SwapBuffers() or screen_refresh() whatever the fuck you want to call it.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Pages: 1
  Print