Added shader support, removed unused debugging puts statements and fixed Gosu Font.draw deprecation warning.

This commit is contained in:
2018-12-10 18:50:25 -06:00
parent 74b0a0ef6f
commit 4d8638d81c
13 changed files with 201 additions and 29 deletions

View File

@@ -77,13 +77,13 @@ class IMICFPS
glMatrixMode(GL_MODELVIEW) # The modelview matrix is where object information is stored.
glLoadIdentity
if $debug && @game_object
glBegin(GL_LINES)
glColor3f(1,0,0)
glVertex3f(@x, @y, @z)
glVertex3f(@game_object.x, @game_object.y, @game_object.z)
glEnd
end
# if $debug && @game_object
# glBegin(GL_LINES)
# glColor3f(1,0,0)
# glVertex3f(@x, @y, @z)
# glVertex3f(@game_object.x, @game_object.y, @game_object.z)
# glEnd
# end
end
def update

View File

@@ -19,8 +19,6 @@ class IMICFPS
@nearest_vertex_lookup[x_slot][y_slot] = [] unless @nearest_vertex_lookup[x_slot][y_slot]
@nearest_vertex_lookup[x_slot][y_slot] << vert
end
p model.faces.first
end
def height_at(vertex, max_distance = Float::INFINITY)

View File

@@ -37,7 +37,7 @@ class IMICFPS
if CACHE[@type].is_a?(Hash)
if CACHE[@type][@file_path]
@model = CACHE[@type][@file_path]#.dup # Don't know why, but adding .dup improves performance with Sponza (1 fps -> 20 fps)
puts "Used cached model for: #{@file_path.split('/').last}"
# puts "Used cached model for: #{@file_path.split('/').last}"
found = true
end
end

View File

@@ -75,20 +75,20 @@ class Text
# _color = Gosu::Color.rgba(@color.red, @color.green, @color.blue, @shadow_alpha) if @shadow_alpha <= @color.alpha
# _color = Gosu::Color.rgba(@color.red, @color.green, @color.blue, @color.alpha) unless @shadow_alpha <= @color.alpha
_color = Gosu::Color::BLACK
@textobject.draw(@text, @x-@shadow_size, @y, @z, @factor_x, @factor_y, _color)
@textobject.draw(@text, @x-@shadow_size, @y-@shadow_size, @z, @factor_x, @factor_y, _color)
@textobject.draw_text(@text, @x-@shadow_size, @y, @z, @factor_x, @factor_y, _color)
@textobject.draw_text(@text, @x-@shadow_size, @y-@shadow_size, @z, @factor_x, @factor_y, _color)
@textobject.draw(@text, @x, @y-@shadow_size, @z, @factor_x, @factor_y, _color)
@textobject.draw(@text, @x+@shadow_size, @y-@shadow_size, @z, @factor_x, @factor_y, _color)
@textobject.draw_text(@text, @x, @y-@shadow_size, @z, @factor_x, @factor_y, _color)
@textobject.draw_text(@text, @x+@shadow_size, @y-@shadow_size, @z, @factor_x, @factor_y, _color)
@textobject.draw(@text, @x, @y+@shadow_size, @z, @factor_x, @factor_y, _color)
@textobject.draw(@text, @x-@shadow_size, @y+@shadow_size, @z, @factor_x, @factor_y, _color)
@textobject.draw_text(@text, @x, @y+@shadow_size, @z, @factor_x, @factor_y, _color)
@textobject.draw_text(@text, @x-@shadow_size, @y+@shadow_size, @z, @factor_x, @factor_y, _color)
@textobject.draw(@text, @x+@shadow_size, @y, @z, @factor_x, @factor_y, _color)
@textobject.draw(@text, @x+@shadow_size, @y+@shadow_size, @z, @factor_x, @factor_y, _color)
@textobject.draw_text(@text, @x+@shadow_size, @y, @z, @factor_x, @factor_y, _color)
@textobject.draw_text(@text, @x+@shadow_size, @y+@shadow_size, @z, @factor_x, @factor_y, _color)
end
@textobject.draw(@text, @x, @y, @z, @factor_x, @factor_y, @color)
@textobject.draw_markup(@text, @x, @y, @z, @factor_x, @factor_y, @color)
end
def update; end