Author Topic: changing display mode  (Read 4899 times)

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
changing display mode
« on: March 08, 2008, 01:19:10 am »
hello,

is it possible to change FrameBuffer's size without destroying it ? LWJGL allows changing display mode while running: Display.setDisplayMode(mode) jPCT continues to operate after change but it doesnt realize mode has changed. if we switch to a larger mode, jPCT renders only to a smaller area on screen, if we switch to a smaller mode, i guess it is over rendering.

is the only way to do this, disable GL renderer, dispose buffer and re-create with new size ? besides that popping efect, jPCT prints warnings below:
WARNING: ZBuffer depth of 24 not supported - trying something else now...!
WARNING: ZBuffer depth is now set to 16bpp!

if i dispose and re-create buffer again, it says:
WARNING: ZBuffer depth of 16 not supported - trying something else now...!
WARNING: ZBuffer depth is now set to 16bpp!

this goes on like this: 24 not supported, 16 not supported, 24 not supported...

and, just for wonder, the javadocs says first GL renderer should be enabled than sw will be disabled. is it really important ? cant we change the order ?

thanks
r a f t

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: changing display mode
« Reply #1 on: March 08, 2008, 11:56:30 am »
It's currently not possible to change a FrameBuffer's size on the fly. I guess i had a reason for this, i just can't remember. However, even it it were, i would still have to do that mode probing and print out the messages. You want to suppress the warning messages, avoid the popping or what exactly is the problem with this behaviour? What i find strange is, that it says 16bpp not supported, using 16bpp...but i guess that's another question. Maybe i used 16bpp as a fallback if nothing else is reported correctly by the driver and ignore that fact that the driver doesn't report it as a valid mode.

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: changing display mode
« Reply #2 on: March 08, 2008, 12:12:03 pm »
so the warning is not that important. it's not printed when GL renderer first enabled, does this mean anything ? it also happens in fps example.

there is no problem, if that warning is ok

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: changing display mode
« Reply #3 on: March 08, 2008, 12:17:07 pm »
The warning is ok. jPCT's mode probing and finding goes through some stages to find the best matching best and laxes the requirements in each step. Everytime it does, it prints out a warning to notify the user that his configured mode can't be matched exactly. That's all. If you dislike the message, set the log level to error and they won't appear anymore...along with all other messages and warnings... ;)

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: changing display mode
« Reply #4 on: March 08, 2008, 12:22:07 pm »
ok, but isnt it strange that warning isnt printed the first time GL renderer is enabled ?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: changing display mode
« Reply #5 on: March 08, 2008, 02:17:44 pm »
Yes, that's a bit strange indeed. I'll look into it, but i wouldn't worry too much about it as long as everything works fine... ;D
BTW: Order of enabling/disabling doesn't matter. I know that the docs sound as if it were, but that's not the case.

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: changing display mode
« Reply #6 on: March 15, 2008, 05:04:39 am »
i've also discovered that, at least on this linux laptop i can set LWJGL screen size to any arbitrary value 8) everything seems to work ok until trying to switch to fullscreen. ;D

btw, i guess for any supported resolution, switching to and back from fullscreen via lwjgl methods wont create any trouble for jPCT ?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: changing display mode
« Reply #7 on: March 15, 2008, 10:28:12 am »
btw, i guess for any supported resolution, switching to and back from fullscreen via lwjgl methods wont create any trouble for jPCT ?
That should be fine. I never tried it, but i don't think that it's a problem.