class GameWindow < Gosu::Window
def initialize
…
@triangle = record(width, height) do
draw_triangle(width/10, height/10, Gosu::Color::RED,
width*9/10, height/2, Gosu::Color::GREEN,
width/2, height*9/10, Gosu::Color::BLUE)
end
…
end
def draw
@triangle.draw(0, 0, 10)
…
end
end
record
(which does not render to a bitmap, but into an OpenGL vertex array). I've created a github issue:draw_quad
instead of draw_triangle
and repeat the third coordinate/colour: draw_quad(width/10, height/10, Gosu::Color::RED,
width*9/10, height/2, Gosu::Color::GREEN,
width/2, height*9/10, Gosu::Color::BLUE,
width/2, height*9/10, Gosu::Color::BLUE)
GL_TRIANGLES
and GL_LINES
are not worth all the special cases in the rendering backend.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill