Skip to content

Commit 7797ece

Browse files
author
Ingo Berg
committed
window size increased
1 parent 21ed62c commit 7797ece

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Diff for: SDLWnd.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ void SDLWindow::Init(int width, int height, double axisLen, const std::string& c
209209
SDL_WINDOWPOS_UNDEFINED,
210210
width, height,
211211
SDL_WINDOW_OPENGL);
212+
212213
if (!_pSdlWnd)
213214
throw std::runtime_error(SDL_GetError());
214215

@@ -262,7 +263,11 @@ void SDLWindow::AdjustCamera()
262263
glLoadIdentity();
263264

264265
double l = _fov / 2.0;
265-
glOrtho(-l, l, -l, l, -l, l);
266+
double aspect = (double)_width / _height;
267+
// glOrtho(-l, l, -l, l, -l, l);
268+
glOrtho(-l* aspect, l * aspect, -l, l, -l, l);
269+
270+
266271
gluLookAt(
267272
_camPos.x, _camPos.y, _camPos.z,
268273
_camLookAt.x, _camLookAt.y, _camLookAt.z,

Diff for: main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int main(int argc, char** argv)
5050
{
5151
// ShowHelp();
5252
GalaxyWnd wndMain;
53-
wndMain.Init(1000, 1000, 35000.0, "Rendering a Galaxy with Density Waves");
53+
wndMain.Init(1500, 1000, 35000.0, "Rendering a Galaxy with Density Waves");
5454
wndMain.MainLoop();
5555
}
5656
catch (std::exception& exc)

0 commit comments

Comments
 (0)