• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Setting up the camera/view for 3D [Potential Bug?]



I'm having a little trouble setting up the view/camera for my 3D game. I followed this guide by Michael to get the 3D all set up, but now I can't seem to be able to set the view/camera size via code.

I suspect this might be a bug, but I decided to ask here in case it isn't and I'm doing something wrong.

My game runs in fullscreen (resolution is 3200 x 1800), but the application surface is still my room size (800 x 640). I used this code to try to set the view wport, hport and camera size to the display size.
view_enabled = true;
view_set_visible(0, true);
view_set_wport( 0, display_get_width() );
view_set_hport( 0, display_get_height() );

camera = camera_create();

projMat = matrix_build_projection_perspective_fov(60, display_get_width()/display_get_height(), 32, 32000);

camera_set_update_script( camera, camera_update_script);
camera_set_view_size( camera, display_get_width(), display_get_height() );
camera_set_proj_mat(camera, projMat);

view_set_camera(0, camera);
Here is what happens.

And yet, commenting out all of my code, and setting the room view settings to the size I want manually works perfectly fine.


Friendly Tyrant
Forum Staff
If you don't resize the app surface to match the view/camera then you get the app surface scaled up to fit.