Use new @include preprocessor added to CyberarmEngin::Shader

This commit is contained in:
2020-01-28 10:48:47 -06:00
parent e7b84bd123
commit c25df59819
7 changed files with 23 additions and 36 deletions

View File

@@ -56,8 +56,7 @@ class IMICFPS
ModelLoader.new(manifest: hash[:manifest], entity: @dummy_entity)
when :shader
if $debug.get(:use_shaders)
shader = Shader.new(name: hash[:name], vertex: "shaders/vertex/#{hash[:name]}.glsl", fragment: "shaders/fragment/#{hash[:name]}.glsl")
Shader.add(hash[:name], shader) if shader.compiled?
shader = Shader.new(name: hash[:name], includes_dir: "shaders/include", vertex: "shaders/vertex/#{hash[:name]}.glsl", fragment: "shaders/fragment/#{hash[:name]}.glsl")
else
warn "Skipping shader: #{hash[:name]}..."
end

View File

@@ -4,7 +4,7 @@ class IMICFPS
attr_reader :camera
attr_reader :console, :delta_time
def initialize(window_width = 1280, window_height = 800, fullscreen = false)
def initialize(window_width = 1280, window_height = 720, fullscreen = false)
fps_target = (ARGV.first.to_i != 0) ? ARGV.first.to_i : 60
if ARGV.join.include?("--native")
super(width: Gosu.screen_width, height: Gosu.screen_height, fullscreen: true, resizable: true, update_interval: 1000.0/fps_target)