Camera view size using projection matrix

What I'm doing: I'm trying to allow a top-down camera to zoom in or out. I've created a custom struct that lets me set camera "modes" that will make it behave certain ways when performing different character actions, but this shouldn't matter. I know that the camera view matrix determines where the camera is aimed, and the projection matrix determines how the world is rendered to the camera. I am using an ortho matrix for top down. The view matrix, which retains the changes I make, performs as expected. The projection matrix, when updated and changed to produce a larger or smaller view area, reverts instantly to the current default size for the game. Using debug commands it seems to happen the instant after attempting to set the new projection matrix, and I am at a loss as to why.

What I've done: This is the function that runs which changes the camera. It is made a method for a camera struct and submitted as the begin script for the respective GM camera. Angle rotation works perfectly, but any zooming is not retained.

GML:
begin_scr  : function() {

                var cx = player.x, cy = player.y, rg = rig;

                rg.angle += keyboard_check(vk_numpad7) - keyboard_check(vk_numpad9);

                rg.angle = rg.angle > 360 ? rg.angle-360 : rg.angle;

              

                var inc = keyboard_check(vk_add) - keyboard_check(vk_subtract);

                var w = camera_get_view_width(camera) + inc*32, h = camera_get_view_height(camera) + inc*18;

                show_debug_message("chng: " + string(w) + ", " + string(h));

                var mat = matrix_build_projection_ortho(w, h, 1, 1000 );

                camera_set_proj_mat(camera, mat);

                camera_apply(camera);

                show_debug_message("size updt: " + string(camera_get_view_width(camera)) + ", " + string(camera_get_view_height(camera)));

              

                camera_set_view_mat(camera, matrix_build_lookat(cx, cy, -10, cx, cy, 0, dsin(rg.angle), dcos(rg.angle), 0));

                camera_apply(camera);

                show_debug_message("size START: " + string(camera_get_view_width(camera)) + ", " + string(camera_get_view_height(camera)));

            }

What I've got:
Debug Output:
...
size STEP END: 1600, 900
size DRAW PRE: 1600, 900
chng: 1632, 918
size updt: 1600, 900
size START: 1600, 900
...

The debug message starting with "chng" shows the correct desired size for the view. The debug message starting with "size updt" shows the dimensions for the view have reverted, even though the angle has not. The game window shows the change while holding the "+" or "-" button, but reverts when released. Does anyone have any idea why this might be happening?
 
Top