lib/mittsu/renderers/opengl_renderer.rb in mittsu-0.3.3 vs lib/mittsu/renderers/opengl_renderer.rb in mittsu-0.4.0
- old
+ new
@@ -33,11 +33,11 @@
:max_morph_targets, :max_morph_normals, :info, :pixel_ratio, :window, :width, :height, :state
attr_reader :logarithmic_depth_buffer, :programs, :light_renderer, :proj_screen_matrix
def initialize(parameters = {})
- puts "OpenGLRenderer (Revision #{REVISION})"
+ puts "Mittsu OpenGL Renderer #{VERSION}"
fetch_parameters(parameters)
@pixel_ratio = 1.0
@sort_objects = true
@@ -933,18 +933,18 @@
def fetch_parameters(parameters)
@_alpha = parameters.fetch(:alpha, false)
@_depth = parameters.fetch(:depth, true)
@_stencil = parameters.fetch(:stencil, true)
- @_antialias = parameters.fetch(:antialias, false)
@_premultiplied_alpha = parameters.fetch(:premultiplied_alpha, true)
@_preserve_drawing_buffer = parameters.fetch(:preserve_drawing_buffer, false)
@logarithmic_depth_buffer = parameters.fetch(:logarithmic_depth_buffer, false)
@width = parameters.fetch(:width, 800)
@height = parameters.fetch(:height, 600)
- @title = parameters.fetch(:title, "Mittsu #{REVISION}")
+ @title = parameters.fetch(:title, "Mittsu #{VERSION}")
+ @antialias = parameters.fetch(:antialias, 0)
end
def get_gpu_capabilities
@_max_textures = glGetParameter(GL_MAX_TEXTURE_IMAGE_UNITS)
@_max_vertex_textures = glGetParameter(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS)
@@ -972,10 +972,10 @@
# antialias: _antialias,
# premultiplied_alpha: _premultiplied_alpha,
# preserve_drawing_buffer: _preserve_drawing_buffer
# }
- @window = GLFW::Window.new(@width, @height, @title)
+ @window = GLFW::Window.new(@width, @height, @title, antialias: @antialias)
default_target.set_viewport_size(*(@window.framebuffer_size))
# TODO: handle losing opengl context??
end