Class: Bestguigui::GLTexture

Inherits:
Object
  • Object
show all
Defined in:
lib/bestguigui_lab/gl_texture.rb

Overview

Texture OpenGL indépendante de l'atlas partagé de Gosu, construite à partir des pixels bruts (to_blob) — permet un vrai GL_REPEAT natif.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = nil) ⇒ GLTexture

path: nil construit une texture blanche 1x1 (repli pour un modèle sans map_Kd dans son .mtl) — voir GLTexture.blank.



11
12
13
14
# File 'lib/bestguigui_lab/gl_texture.rb', line 11

def initialize(path = nil)
    super()
    @tex_name = path ? upload_image(path) : upload_blank
end

Instance Attribute Details

#tex_name ⇒ Object (readonly)

Returns the value of attribute tex_name.



7
8
9
# File 'lib/bestguigui_lab/gl_texture.rb', line 7

def tex_name
  @tex_name
end

Class Method Details

.blank ⇒ Object



16
# File 'lib/bestguigui_lab/gl_texture.rb', line 16

def self.blank = new