Jump to content


Photo

Resolution problems (solved)


  • Please log in to reply
6 replies to this topic

#1 anatheron

anatheron

    GMC Member

  • New Member
  • 27 posts

Posted 21 March 2012 - 08:27 PM

Hi guys!

So I'm making this game, it's 3d, I use fullscreen and I'm trying make it possible to change the resolution of the game.
I'm not trying to make it so that you cahnge the resolution in realtime though. what I want is for the user to set the resolution in the options menu and then they have to restart the game for it to take effect.

here is my code (it's in the camera creation event):
file = ini_open('system/graphics.ini');

sw = ini_read_real('resolution','screen_width',1920);
sh = ini_read_real('resolution','screen_height',1080);

ini_close();

view_xview[0] = 0;
view_yview[0] = 0;
view_wview[0] = sw;
view_hview[0] = sh;

view_xport[0] = 0;
view_yport[0] = 0;
view_wport[0] = sw;
view_hport[0] = sh;

as you can probably see the resolution is taken from an ini file and this works fine. the problem is that when i start the game I only see a small part of what I'm supposed to see (the top left corner). Is there any good explanation for this?

Remember that i'm in 3d mode and use fullscreen.
I have also tried putting the code elsewhere, like draw event and room creation code.

Edited by anatheron, 26 March 2012 - 01:19 PM.

  • 0

#2 TechnoGeek4681

TechnoGeek4681

    GMC Member

  • New Member
  • 143 posts
  • Version:GM8

Posted 22 March 2012 - 02:43 AM

You might need to use the window_set_width or window_set_height functions as well (i think those are their names)
  • 0

#3 anatheron

anatheron

    GMC Member

  • New Member
  • 27 posts

Posted 23 March 2012 - 12:46 PM

You might need to use the window_set_width or window_set_height functions as well (i think those are their names)

already tried that... still get the same prob :S

Edited by anatheron, 23 March 2012 - 12:47 PM.

  • 0

#4 ramses12

ramses12

    6

  • GMC Member
  • 5769 posts
  • Version:GM8.1

Posted 23 March 2012 - 03:02 PM

Try resetting the drawing region data with window_set_region_size(). Play a bit with the arguments. If that doesn't do the work, it's nothing I can do about it.
  • 0

#5 brac37

brac37

    GMC Member

  • GMC Member
  • 765 posts
  • Version:GM7

Posted 23 March 2012 - 08:09 PM

I think you do not need to change view. Only change port.
  • 0

#6 anatheron

anatheron

    GMC Member

  • New Member
  • 27 posts

Posted 25 March 2012 - 11:54 PM

Okey i solved it :D

when I start the game I have an object with a game start event with this code in it
graphSet = ini_open('system/graphics.ini');

sw = ini_read_real('resolution','screen_width',1920);
sh = ini_read_real('resolution','screen_height',1080);

ini_close();

view_xport[0] = 0;
view_yport[0] = 0;
view_wport[0] = sw;
view_hport[0] = sh;

room_restart();


it works perfectly :P
Btw, I don't really know how to change the name of the topic to say solved >.< halp?
  • 0

#7 Robert3DG+

Robert3DG+

    VR Games

  • GMC Member
  • 1841 posts
  • Version:GM:Studio

Posted 26 March 2012 - 01:04 AM

Edit your first post and use the "Full Editor". It will then show the title fields again and you can change them.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users