ogre.rb 0.1-i386-mswin32 → 0.2-i386-mswin32

Sign up to get free protection for your applications and to get access to all the features.
data/samples/plugins.cfg CHANGED
@@ -1,7 +1,7 @@
1
1
  # Defines plugins to load
2
2
 
3
3
  # Define plugin folder
4
- PluginFolder=D:\Programming\engines\Ogre1.4.1SDK\bin\release
4
+ PluginFolder=D:\Programming\engines\Ogre1.4.4SDK\bin\release
5
5
  #PluginFolder=/usr/local/lib/OGRE/
6
6
 
7
7
  Plugin=RenderSystem_GL
data/test/ogre.cfg ADDED
@@ -0,0 +1,10 @@
1
+ Render System=OpenGL Rendering Subsystem
2
+
3
+ [OpenGL Rendering Subsystem]
4
+ Colour Depth=32
5
+ Display Frequency=N/A
6
+ FSAA=0
7
+ Full Screen=No
8
+ RTT Preferred Mode=FBO
9
+ VSync=No
10
+ Video Mode=1024 x 768
data/test/plugins.cfg ADDED
@@ -0,0 +1,8 @@
1
+ # Defines plugins to load
2
+
3
+ # Define plugin folder
4
+ PluginFolder=D:\Programming\engines\Ogre1.4.4SDK\bin\release
5
+ #PluginFolder=/usr/local/lib/OGRE/
6
+
7
+ Plugin=RenderSystem_GL
8
+ #Plugin=Plugin_ParticleFX
@@ -0,0 +1,67 @@
1
+ $: << File.expand_path( File.dirname(__FILE__) )
2
+ require File.dirname(__FILE__) + "/../ogre"
3
+ require "test/unit"
4
+
5
+ class Test::Unit::TestCase
6
+ include Ogre
7
+
8
+ # Run through Ogre setup routines so we have access to the system.
9
+ #
10
+ # Any test classes that override #setup will need to call super
11
+ #
12
+ # I use class variables to make sure only one window pops up instead
13
+ # of one per test case, which would make things really, really slow.
14
+ # In the else clause here, do any cleanup you need.
15
+ def setup
16
+ @@root ||= nil
17
+ unless @@root
18
+ @@log_manager = LogManager.new
19
+ @@log_manager.create_log("Test.log",true,false,false)
20
+
21
+ dir = File.expand_path( File.dirname(__FILE__) )
22
+ @@root = Root.new "#{dir}/plugins.cfg", "#{dir}/ogre.cfg", "Test.log"
23
+ @@scene_manager = @@root.create_scene_manager(ST_GENERIC, "test")
24
+
25
+ # If needed later
26
+ #media_path = File.expand_path(File.dirname(__FILE__)+"/media")
27
+ #ResourceGroupManager.instance.add_resource_location(media_path, "FileSystem", "General")
28
+
29
+ # Find a renderer to use
30
+ renderers = @@root.get_available_renderers
31
+ @@root.set_render_system(renderers[0])
32
+
33
+ @@root.initialise(false)
34
+
35
+ # I really, really don't want this!
36
+ # but I don't seem to have a choice right now.
37
+ @@window = @@root.create_render_window("Testing Ogre", 320, 240, false)
38
+
39
+ ResourceGroupManager.instance.initialise_all_resource_groups
40
+ end
41
+ end
42
+
43
+ def teardown
44
+ @@scene_manager.clear_scene
45
+ end
46
+
47
+ def scene_manager
48
+ @@scene_manager
49
+ end
50
+
51
+ def window
52
+ @@window
53
+ end
54
+
55
+
56
+ # An interesting BDD function
57
+ def self.should(behave,&block)
58
+ mname = "test_should_#{behave}"
59
+ if block
60
+ define_method mname, &block
61
+ else
62
+ define_method mname do
63
+ flunk "#{self.class.name.sub(/Test$/,'')} should #{behave}"
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,138 @@
1
+ 20:44:26: Creating resource group General
2
+ 20:44:26: Creating resource group Internal
3
+ 20:44:26: Creating resource group Autodetect
4
+ 20:44:26: SceneManagerFactory for type 'DefaultSceneManager' registered.
5
+ 20:44:26: Registering ResourceManager for type Material
6
+ 20:44:26: Registering ResourceManager for type Mesh
7
+ 20:44:26: Registering ResourceManager for type Skeleton
8
+ 20:44:26: MovableObjectFactory for type 'ParticleSystem' registered.
9
+ 20:44:26: OverlayElementFactory for type Panel registered.
10
+ 20:44:26: OverlayElementFactory for type BorderPanel registered.
11
+ 20:44:26: OverlayElementFactory for type TextArea registered.
12
+ 20:44:26: Registering ResourceManager for type Font
13
+ 20:44:26: ArchiveFactory for archive type FileSystem registered.
14
+ 20:44:26: ArchiveFactory for archive type Zip registered.
15
+ 20:44:26: FreeImage version: 3.9.2
16
+ 20:44:26: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
17
+ 20:44:26: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi
18
+ 20:44:26: DDS codec registering
19
+ 20:44:26: Registering ResourceManager for type HighLevelGpuProgram
20
+ 20:44:26: Registering ResourceManager for type Compositor
21
+ 20:44:26: MovableObjectFactory for type 'Entity' registered.
22
+ 20:44:26: MovableObjectFactory for type 'Light' registered.
23
+ 20:44:26: MovableObjectFactory for type 'BillboardSet' registered.
24
+ 20:44:26: MovableObjectFactory for type 'ManualObject' registered.
25
+ 20:44:26: MovableObjectFactory for type 'BillboardChain' registered.
26
+ 20:44:26: MovableObjectFactory for type 'RibbonTrail' registered.
27
+ 20:44:26: Loading library D:\Programming\engines\Ogre1.4.1SDK\bin\release\RenderSystem_GL
28
+ 20:44:26: Installing plugin: GL RenderSystem
29
+ 20:44:26: OpenGL Rendering Subsystem created.
30
+ 20:44:27: Plugin successfully installed
31
+ 20:44:27: *-*-* OGRE Initialising
32
+ 20:44:27: *-*-* Version 1.4.1 (Eihort)
33
+ 20:44:27: CPU Identifier & Features
34
+ 20:44:27: -------------------------
35
+ 20:44:27: * CPU ID: AuthenticAMD: AMD Athlon(tm) 64 Processor 3200+
36
+ 20:44:27: * SSE: yes
37
+ 20:44:27: * SSE2: yes
38
+ 20:44:27: * SSE3: yes
39
+ 20:44:27: * MMX: yes
40
+ 20:44:27: * MMXEXT: yes
41
+ 20:44:27: * 3DNOW: yes
42
+ 20:44:27: * 3DNOWEXT: yes
43
+ 20:44:27: * CMOV: yes
44
+ 20:44:27: * TSC: yes
45
+ 20:44:27: * FPU: yes
46
+ 20:44:27: * PRO: yes
47
+ 20:44:27: * HT: no
48
+ 20:44:27: -------------------------
49
+ 20:44:27: *** Starting Win32GL Subsystem ***
50
+ 20:44:27: Created Win32Window 'Testing Ogre' : 320x240, 32bpp
51
+ 20:44:27: GL_VERSION = 2.0.3
52
+ 20:44:27: GL_VENDOR = NVIDIA Corporation
53
+ 20:44:27: GL_RENDERER = GeForce 6800 GT/PCI/SSE2/3DNOW!
54
+ 20:44:27: GL_EXTENSIONS = GL_ARB_color_buffer_float GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_half_float_pixel GL_ARB_imaging GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_shadow GL_ARB_shader_objects GL_ARB_shading_language_100 GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_transpose_matrix GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once GL_S3_s3tc GL_EXT_texture_env_add GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_Cg_shader GL_EXT_depth_bounds_test GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_object GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_sRGB GL_EXT_timer_query GL_EXT_vertex_array GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square GL_NV_copy_depth_to_color GL_NV_depth_clamp GL_NV_fence GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_program GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_half_float GL_NV_light_max_exponent GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_texgen_reflection GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_expand_normal GL_NV_texture_rectangle GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NVX_conditional_render GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum GL_WIN_swap_hint WGL_EXT_swap_control
55
+ 20:44:27: Supported WGL extensions: WGL_ARB_buffer_region WGL_ARB_extensions_string WGL_ARB_make_current_read WGL_ARB_multisample WGL_ARB_pbuffer WGL_ARB_pixel_format WGL_ARB_render_texture WGL_ATI_pixel_format_float WGL_EXT_extensions_string WGL_EXT_swap_control WGL_NV_float_buffer WGL_NV_render_depth_texture WGL_NV_render_texture_rectangle
56
+ 20:44:27: ***************************
57
+ 20:44:27: *** GL Renderer Started ***
58
+ 20:44:27: ***************************
59
+ 20:44:27: Registering ResourceManager for type GpuProgram
60
+ 20:44:27: GLSL support detected
61
+ 20:44:27: GL: Using GL_EXT_framebuffer_object for rendering to textures (best)
62
+ 20:44:27: FBO PF_UNKNOWN depth/stencil support: D16S0 D24S0 D32S0 Packed-D24S8
63
+ 20:44:27: FBO PF_R5G6B5 depth/stencil support: D0S0 D16S0
64
+ 20:44:27: FBO PF_B5G6R5 depth/stencil support: D0S0 D16S0
65
+ 20:44:27: FBO PF_R8G8B8 depth/stencil support: D0S0 D24S0 D32S0 Packed-D24S8
66
+ 20:44:27: FBO PF_B8G8R8 depth/stencil support: D0S0 D24S0 D32S0 Packed-D24S8
67
+ 20:44:27: FBO PF_A8R8G8B8 depth/stencil support: D0S0 D24S0 D32S0 Packed-D24S8
68
+ 20:44:27: FBO PF_B8G8R8A8 depth/stencil support: D0S0 D24S0 D32S0 Packed-D24S8
69
+ 20:44:27: FBO PF_A2R10G10B10 depth/stencil support: D0S0 D24S0 D32S0 Packed-D24S8
70
+ 20:44:27: FBO PF_A2B10G10R10 depth/stencil support: D0S0 D24S0 D32S0 Packed-D24S8
71
+ 20:44:27: FBO PF_FLOAT16_RGB depth/stencil support: D0S0 D24S0 D32S0 Packed-D24S8
72
+ 20:44:27: FBO PF_FLOAT16_RGBA depth/stencil support: D0S0 D24S0 D32S0 Packed-D24S8
73
+ 20:44:27: FBO PF_FLOAT32_RGB depth/stencil support: D0S0 D24S0 D32S0 Packed-D24S8
74
+ 20:44:27: FBO PF_FLOAT32_RGBA depth/stencil support: D0S0 D24S0 D32S0 Packed-D24S8
75
+ 20:44:27: FBO PF_X8R8G8B8 depth/stencil support: D0S0 D24S0 D32S0 Packed-D24S8
76
+ 20:44:27: FBO PF_X8B8G8R8 depth/stencil support: D0S0 D24S0 D32S0 Packed-D24S8
77
+ 20:44:27: FBO PF_SHORT_RGBA depth/stencil support: D0S0 D24S0 D32S0 Packed-D24S8
78
+ 20:44:27: FBO PF_R3G3B2 depth/stencil support: D0S0 D16S0
79
+ 20:44:27: FBO PF_SHORT_RGB depth/stencil support: D0S0 D24S0 D32S0 Packed-D24S8
80
+ 20:44:27: [GL] : Valid FBO targets PF_UNKNOWN PF_R5G6B5 PF_B5G6R5 PF_R8G8B8 PF_B8G8R8 PF_A8R8G8B8 PF_B8G8R8A8 PF_A2R10G10B10 PF_A2B10G10R10 PF_FLOAT16_RGB PF_FLOAT16_RGBA PF_FLOAT32_RGB PF_FLOAT32_RGBA PF_X8R8G8B8 PF_X8B8G8R8 PF_SHORT_RGBA PF_R3G3B2 PF_SHORT_RGB
81
+ 20:44:27: RenderSystem capabilities
82
+ 20:44:27: -------------------------
83
+ 20:44:27: * Hardware generation of mipmaps: yes
84
+ 20:44:27: * Texture blending: yes
85
+ 20:44:27: * Anisotropic texture filtering: yes
86
+ 20:44:27: * Dot product texture operation: yes
87
+ 20:44:27: * Cube mapping: yes
88
+ 20:44:27: * Hardware stencil buffer: yes
89
+ 20:44:27: - Stencil depth: 8
90
+ 20:44:27: - Two sided stencil support: yes
91
+ 20:44:27: - Wrap stencil values: yes
92
+ 20:44:27: * Hardware vertex / index buffers: yes
93
+ 20:44:27: * Vertex programs: yes
94
+ 20:44:27: - Max vertex program version: vp40
95
+ 20:44:27: * Fragment programs: yes
96
+ 20:44:27: - Max fragment program version: fp40
97
+ 20:44:27: * Texture Compression: yes
98
+ 20:44:27: - DXT: yes
99
+ 20:44:27: - VTC: yes
100
+ 20:44:27: * Scissor Rectangle: yes
101
+ 20:44:27: * Hardware Occlusion Query: yes
102
+ 20:44:27: * User clip planes: yes
103
+ 20:44:27: * VET_UBYTE4 vertex element type: yes
104
+ 20:44:27: * Infinite far plane projection: yes
105
+ 20:44:27: * Hardware render-to-texture: yes
106
+ 20:44:27: * Floating point textures: yes
107
+ 20:44:27: * Non-power-of-two textures: yes
108
+ 20:44:27: * Volume textures: yes
109
+ 20:44:27: * Multiple Render Targets: 4
110
+ 20:44:27: * Point Sprites: yes
111
+ 20:44:27: * Extended point parameters: yes
112
+ 20:44:27: * Max Point Size: 63.375
113
+ 20:44:27: * Vertex texture fetch: yes
114
+ 20:44:27: - Max vertex textures: 4
115
+ 20:44:27: - Vertex textures shared: yes
116
+ 20:44:27: Registering ResourceManager for type Texture
117
+ 20:44:27: ResourceBackgroundQueue - threading disabled
118
+ 20:44:27: Particle Renderer Type 'billboard' registered
119
+ 20:44:27: Parsing scripts for resource group Autodetect
120
+ 20:44:27: Finished parsing scripts for resource group Autodetect
121
+ 20:44:27: Parsing scripts for resource group General
122
+ 20:44:27: Finished parsing scripts for resource group General
123
+ 20:44:27: Parsing scripts for resource group Internal
124
+ 20:44:27: Finished parsing scripts for resource group Internal
125
+ 20:44:27: *-*-* OGRE Shutdown
126
+ 20:44:27: Unregistering ResourceManager for type Compositor
127
+ 20:44:27: Unregistering ResourceManager for type Font
128
+ 20:44:27: Unregistering ResourceManager for type Skeleton
129
+ 20:44:27: Unregistering ResourceManager for type Mesh
130
+ 20:44:27: Unregistering ResourceManager for type HighLevelGpuProgram
131
+ 20:44:27: Uninstalling plugin: GL RenderSystem
132
+ 20:44:27: Render Target 'Testing Ogre' Average FPS: 0 Best FPS: 0 Worst FPS: 999
133
+ 20:44:27: Unregistering ResourceManager for type GpuProgram
134
+ 20:44:27: *** Stopping Win32GL Subsystem ***
135
+ 20:44:27: Unregistering ResourceManager for type Texture
136
+ 20:44:27: Plugin successfully uninstalled
137
+ 20:44:27: Unloading library D:\Programming\engines\Ogre1.4.1SDK\bin\release\RenderSystem_GL
138
+ 20:44:27: Unregistering ResourceManager for type Material
@@ -0,0 +1,66 @@
1
+ require File.dirname(__FILE__) + "/../test_helper"
2
+
3
+ class ConstantsTest < Test::Unit::TestCase
4
+
5
+ should "have constantized methods for Vector3" do
6
+ {
7
+ :ZERO => [0, 0, 0],
8
+ :UNIT_X => [1, 0, 0],
9
+ :UNIT_Y => [0, 1, 0],
10
+ :UNIT_Z => [0, 0, 1],
11
+ :NEGATIVE_UNIT_X => [-1, 0, 0],
12
+ :NEGATIVE_UNIT_Y => [0, -1, 0],
13
+ :NEGATIVE_UNIT_Z => [0, 0, -1],
14
+ :UNIT_SCALE => [1, 1, 1]
15
+ }.each do |method, expected|
16
+ vec = Vector3.send(method)
17
+ assert_equal expected, [vec.x, vec.y, vec.z]
18
+
19
+ # And test that we don't destroy the initial data like
20
+ # Ruby constants like to do
21
+ vec.x = 10
22
+ vec.y = 20
23
+ vec.z = 30
24
+ vec2 = Vector3.send(method)
25
+ assert_not_equal [vec2.x, vec2.y, vec2.z], [vec.x, vec.y, vec.z]
26
+ end
27
+ end
28
+
29
+ should "have constantized methods for Vector4" do
30
+ {
31
+ :ZERO => [0, 0, 0, 0],
32
+ }.each do |method, expected|
33
+ vec = Vector4.send(method)
34
+ assert_equal expected, [vec.x, vec.y, vec.z, vec.w]
35
+
36
+ # And test that we don't destroy the initial data like
37
+ # Ruby constants like to do
38
+ vec.x = 10
39
+ vec.y = 20
40
+ vec.z = 30
41
+ vec.w = 40
42
+ vec2 = Vector4.send(method)
43
+ assert_not_equal [vec2.x, vec2.y, vec2.z, vec2.w], [vec.x, vec.y, vec.z, vec.w]
44
+ end
45
+ end
46
+
47
+ should "have constantized methods for Quanternion" do
48
+ {
49
+ :ZERO => [0.0, 0.0, 0.0, 0.0],
50
+ :IDENTITY => [1.0, 0.0, 0.0, 0.0]
51
+ }.each do |method, expected|
52
+ quat = Quaternion.send(method)
53
+ assert_equal expected, [quat.w, quat.x, quat.y, quat.z]
54
+
55
+ # And test that we don't destroy the initial data like
56
+ # Ruby constants like to do
57
+ quat.x = 10
58
+ quat.y = 20
59
+ quat.z = 30
60
+ quat.w = 40
61
+ quat2 = Quaternion.send(method)
62
+ assert_not_equal [quat2.x, quat2.y, quat2.z, quat2.w], [quat.x, quat.y, quat.z, quat.w]
63
+ end
64
+ end
65
+
66
+ end
@@ -0,0 +1,28 @@
1
+ require File.dirname(__FILE__) + "/../test_helper"
2
+
3
+ class FrameStatsProxyTest < Test::Unit::TestCase
4
+
5
+ should "wrap Ogre::FrameStats into our own FrameStatsProxy" do
6
+ stats = window.get_statistics
7
+ assert_not_nil stats
8
+ assert stats.is_a?(FrameStatsProxy)
9
+ end
10
+
11
+ should "have certain methods for accessing render stats" do
12
+ stats = FrameStatsProxy.new window
13
+
14
+ %w(
15
+ last_fps
16
+ avg_fps
17
+ best_fps
18
+ worst_fps
19
+ best_frame_time
20
+ worst_frame_time
21
+ triangle_count
22
+ batch_count
23
+ ).each do |method|
24
+ assert stats.respond_to?(method)
25
+ end
26
+ end
27
+
28
+ end
@@ -0,0 +1,20 @@
1
+ require File.dirname(__FILE__) + "/../test_helper"
2
+
3
+ class MathTest < Test::Unit::TestCase
4
+
5
+ should "properly take in Degrees and Radians interchangably" do
6
+ light = scene_manager.create_light("Testing Light")
7
+
8
+ rad = Radian.new(::Math::PI)
9
+ deg = Degree.new(180)
10
+
11
+ # Radians in, Radians out
12
+ light.set_spotlight_inner_angle(rad)
13
+ assert_equal rad, light.get_spotlight_inner_angle
14
+
15
+ # Degrees in, Radians out
16
+ light.set_spotlight_inner_angle(deg)
17
+ assert_in_delta rad.value_radians,
18
+ light.get_spotlight_inner_angle.value_radians, 0.0001
19
+ end
20
+ end
@@ -0,0 +1,15 @@
1
+ require File.dirname(__FILE__) + "/../test_helper"
2
+
3
+ class MeshTest < Test::Unit::TestCase
4
+
5
+ should "have a few new methods" do
6
+ assert Mesh.instance_methods.include?("shared_vertex_data=")
7
+ assert Mesh.instance_methods.include?("shared_vertex_data")
8
+ assert Mesh.instance_methods.include?("suggest_tangent_vector_build_params")
9
+ end
10
+
11
+ should "not have other methods" do
12
+ assert !Mesh.instance_methods.include?("get_pose_iterator")
13
+ end
14
+
15
+ end
@@ -0,0 +1,98 @@
1
+ require File.dirname(__FILE__) + "/../test_helper"
2
+
3
+ class MethodsTest < Test::Unit::TestCase
4
+
5
+ should "be able to access Singletons through #instance" do
6
+ assert ResourceGroupManager.respond_to?(:instance)
7
+ assert MeshManager.respond_to?(:instance)
8
+ assert MaterialManager.respond_to?(:instance)
9
+ end
10
+
11
+ should "have numerous bang (!) or query (?) methods" do
12
+ assert Vector3.new.respond_to?(:normalise!)
13
+ assert RenderWindow.instance_methods.include?("closed?")
14
+ assert SubMesh.instance_methods.include?("is_mat_initialised?")
15
+ end
16
+
17
+ should "have certain methods" do
18
+ assert FrameEvent.instance_methods.include?("time_since_last_frame")
19
+ assert FrameEvent.instance_methods.include?("time_since_last_event")
20
+ end
21
+
22
+ should "be ignoring other methods for various reasons" do
23
+ assert !AxisAlignedBox.new.respond_to?(:get_corner)
24
+
25
+ assert !ResourceGroupManager.instance.respond_to?(:resource_exists)
26
+
27
+ assert !BillboardChain.instance_methods.include?(:add_chain_element)
28
+ assert !BillboardChain.instance_methods.include?(:update_chain_element)
29
+ assert !BillboardChain.instance_methods.include?(:get_chain_element)
30
+
31
+ assert !ConfigFile.instance_methods.include?(:load)
32
+
33
+ assert !KeyFrame.instance_methods.include?(:get_post_reference_iterator)
34
+
35
+ assert !Node.instance_methods.include?(:get_child_iterator)
36
+ assert !Node.instance_methods.include?(:set_listener)
37
+ assert !Node.instance_methods.include?(:get_listener)
38
+
39
+ assert !ParticleSystem.instance_methods.include?(:_get_iterator)
40
+
41
+ assert !Pass.instance_methods.include?(:set_hash_function)
42
+ assert !Pass.instance_methods.include?(:get_hash_function)
43
+
44
+ assert !PatchMesh.instance_methods.include?(:get_pose_iterator)
45
+
46
+ assert !RenderQueue.instance_methods.include?(:set_renderable_listener)
47
+ assert !RenderQueue.instance_methods.include?(:get_renderable_listener)
48
+
49
+ assert !RenderSystem.instance_methods.include?(:add_listener)
50
+ assert !RenderSystem.instance_methods.include?(:remove_listener)
51
+ assert !RenderSystem.instance_methods.include?(:register_thread)
52
+ assert !RenderSystem.instance_methods.include?(:unregister_thread)
53
+
54
+ assert !SceneNode.instance_methods.include?(:get_attached_object_iterator)
55
+
56
+ assert !TextureUnitState.instance_methods.include?(:add_effect)
57
+ assert !TextureUnitState.instance_methods.include?(:remove_effect)
58
+
59
+ assert !ManualObject.instance_methods.include?(:get_shadow_volume_renderable_iterator)
60
+ end
61
+
62
+ should "have fixed method names related to public instance variables of classes (method_fixes.rb)" do
63
+ %w(
64
+ use_shared_vertices?
65
+ use_shared_vertices=
66
+ vertex_data
67
+ vertex_data=
68
+ index_data
69
+ index_data=
70
+ ).each do |method|
71
+ assert SubMesh.new.respond_to?(method)
72
+ end
73
+
74
+ %w(
75
+ vertex_declaration
76
+ vertex_declaration=
77
+ vertex_buffer_binding
78
+ vertex_buffer_binding=
79
+ vertex_start
80
+ vertex_start=
81
+ vertex_count
82
+ vertex_count=
83
+ ).each do |method|
84
+ assert VertexData.new.respond_to?(method)
85
+ end
86
+
87
+ %w(
88
+ index_buffer
89
+ index_buffer=
90
+ index_start
91
+ index_start=
92
+ index_count
93
+ index_count=
94
+ ).each do |method|
95
+ assert IndexData.new.respond_to?(method)
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,19 @@
1
+ require File.dirname(__FILE__) + "/../test_helper"
2
+
3
+ class MovableObjectTest < Test::Unit::TestCase
4
+
5
+ should "be properly cast to their real subclasses on C++ -> Ruby" do
6
+ mo = scene_manager.create_movable_object("myThingy", "Light", {})
7
+ assert_equal "myThingy", mo.get_name
8
+ assert mo.is_a?(Light)
9
+ end
10
+
11
+ should "not have listener methods" do
12
+ mo = scene_manager.create_movable_object("myThingy", "Light", {})
13
+
14
+ assert !mo.respond_to?(:set_listener)
15
+ assert !mo.respond_to?(:get_listener)
16
+ assert !mo.respond_to?(:extract_movable_object)
17
+ end
18
+
19
+ end
@@ -0,0 +1,12 @@
1
+ require File.dirname(__FILE__) + "/../test_helper"
2
+
3
+ class NameValuePairListTest < Test::Unit::TestCase
4
+
5
+ should "be able to pass in a Ruby hash into methods expecting NameValuePairList" do
6
+ trail = scene_manager.create_movable_object("RibbonTrail1", "RibbonTrail",
7
+ {"numberOfChains" => "2", "maxElements" => "80"})
8
+ assert_equal 80, trail.get_max_chain_elements
9
+ assert_equal 2, trail.get_number_of_chains
10
+ end
11
+
12
+ end
@@ -0,0 +1,20 @@
1
+ require File.dirname(__FILE__) + "/../test_helper"
2
+
3
+ class OverlayElementTest < Test::Unit::TestCase
4
+
5
+ should "be properly cast to their real subclasses on C++ -> Ruby" do
6
+ element = OverlayManager.instance.create_overlay_element("Panel", "TestPanel")
7
+ assert_not_nil element
8
+ assert element.is_a?(PanelOverlayElement)
9
+
10
+ text_element = OverlayManager.instance.create_overlay_element("TextArea",
11
+ "Tester")
12
+ assert_not_nil text_element
13
+ assert text_element.is_a?(TextAreaOverlayElement)
14
+
15
+ element2 = OverlayManager.instance.get_overlay_element("TestPanel")
16
+ assert element2.is_a?(PanelOverlayElement)
17
+ assert_equal element.get_name, element2.get_name
18
+ end
19
+
20
+ end
@@ -0,0 +1,11 @@
1
+ require File.dirname(__FILE__) + "/../test_helper"
2
+
3
+ class RenderTargetTest < Test::Unit::TestCase
4
+
5
+ should "have a specially wrapped getCustomAttribute method" do
6
+ assert window.respond_to?(:get_custom_attribute_unsigned_long)
7
+ assert !RenderTarget.instance_methods.include?("get_custom_attribute")
8
+ assert !RenderTarget.instance_methods.include?("_getImpl")
9
+ end
10
+
11
+ end
@@ -0,0 +1,26 @@
1
+ require File.dirname(__FILE__) + "/../test_helper"
2
+
3
+ class ResourceTest < Test::Unit::TestCase
4
+
5
+ def teardown
6
+ super
7
+ MeshManager.instance.remove_all
8
+ end
9
+
10
+ should "be properly cast to their real subclasses on C++ -> Ruby" do
11
+ mesh = MeshManager.instance.create("TestMesh", "General")
12
+ assert mesh.is_a?(MeshPtr)
13
+
14
+ material = MaterialManager.instance.create("TestMaterial", "General")
15
+ assert material.is_a?(MaterialPtr)
16
+ end
17
+
18
+ should "not have listener methods" do
19
+ mesh = MeshManager.instance.create("TestMesh", "General")
20
+
21
+ assert !mesh.respond_to?(:add_listener)
22
+ assert !mesh.respond_to?(:remove_listener)
23
+ assert !mesh.respond_to?(:extract_resource)
24
+ end
25
+
26
+ end
@@ -0,0 +1,21 @@
1
+ require File.dirname(__FILE__) + "/../test_helper"
2
+
3
+ class SceneManagerTest < Test::Unit::TestCase
4
+
5
+ should "have a renamed getRootSceneNode method" do
6
+ assert scene_manager.respond_to?(:root_scene_node)
7
+ end
8
+
9
+ should "not have a few methods" do
10
+ %w(
11
+ get_sky_plane_gen_parameters
12
+ get_sky_dome_gen_parameters
13
+ get_sky_box_gen_parameters
14
+ set_queued_renderable_visitor
15
+ get_queued_renderable_visitor
16
+ ).each do |method|
17
+ assert !scene_manager.respond_to?(method)
18
+ end
19
+ end
20
+
21
+ end