Преглед изворни кода

tutorial: fix a compilation error and remove now useless vector type casts.

legacy
Sam Hocevar sam пре 12 година
родитељ
комит
8f0fc94027
1 измењених фајлова са 4 додато и 6 уклоњено
  1. +4
    -6
      test/tutorial/tut03.cpp

+ 4
- 6
test/tutorial/tut03.cpp Прегледај датотеку

@@ -67,9 +67,8 @@ public:
m_size = size;
m_size.x = (m_size.x + 15) & ~15;
m_size.y = (m_size.y + 15) & ~15;
/* FIXME: casts are necessary because of missing operators */
m_texel_settings = vec4(1.0, 1.0, 2.0, 2.0) / (vec4)m_size.xyxy;
m_screen_settings = vec4(1.0, 1.0, 0.5, 0.5) * (vec4)m_size.xyxy;
m_texel_settings = vec4(1.0, 1.0, 2.0, 2.0) / m_size.xyxy;
m_screen_settings = vec4(1.0, 1.0, 0.5, 0.5) * m_size.xyxy;

/* Window size decides the world aspect ratio. For instance, 640×480
* will be mapped to (-0.66,-0.5) - (0.66,0.5). */
@@ -83,8 +82,7 @@ public:
m_window2world = 0.5 / m_window_size.y;
else
m_window2world = 0.5 / m_window_size.x;
m_texel2world = (vec2)m_window_size / (vec2)m_size
* (vec2)m_window2world;
m_texel2world = (vec2)m_window_size / m_size * m_window2world;

m_oldmouse = ivec2(0, 0);

@@ -867,7 +865,7 @@ private:

int main(int argc, char **argv)
{
Application app("Tutorial 3: Fractal", ivec2(640, 480, 60.0f);
Application app("Tutorial 3: Fractal", ivec2(640, 480), 60.0f);

#if defined _MSC_VER && !defined _XBOX
_chdir("..");


Loading…
Откажи
Сачувај