1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-15 06:52:34 +02:00

Fixed aspect ratio and window sizeablility

This commit is contained in:
Daniel Evans 2013-07-02 09:09:40 +01:00
parent b7da2815ad
commit cf4f451d15

View File

@ -114,6 +114,9 @@ void update()
void render()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Update aspect ratio..
gta->renderer.camera.frustum.aspectRatio = window.getSize().x / (float) window.getSize().y;
gta->renderer.renderWorld(gta);
}
@ -128,7 +131,7 @@ int main(int argc, char *argv[])
glewExperimental = GL_TRUE;
glewInit();
window.create(sf::VideoMode(WIDTH, HEIGHT), "GTA3 Viewer", sf::Style::Close);
window.create(sf::VideoMode(WIDTH, HEIGHT), "GTA3 Viewer", sf::Style::Close | sf::Style::Resize);
window.setVerticalSyncEnabled(true);
init(argv[1]);