Skip to content

Incorrect Render Size on Macbook Pro M1 #63

@SubstituteR

Description

@SubstituteR

When building another project of yours that uses librw on the Macbook Pro M1, the in-game rendered world is incorrectly sized. It is roughly twice the width and height vs the actual framebuffer. This is probably due to Retina.

I was able to fix it by changing the following

librw/src/gl/gl3device.cpp

Lines 1256 to 1257 in 373f839

float32 invwx = 1.0f/cam->viewWindow.x;
float32 invwy = 1.0f/cam->viewWindow.y;

to

	float32 invwx = 1.0f/cam->viewWindow.x/2;
	float32 invwy = 1.0f/cam->viewWindow.y/2;

and by changing

librw/src/gl/gl3device.cpp

Lines 1400 to 1401 in 373f839

glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x, (dst->height-src->height)-y,
0, 0, src->width, src->height);

to

			glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x, (dst->height-src->height)-y,
				src->width/2, src->height/2, src->width, src->height);

I'm not knowledable enough in your engine or OpenGL to see why this happens, but if you are unable, or unwilling, I can try to investigate the root cause, if there is one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions