Ogre

From Schmid.wiki
Jump to: navigation, search

Contents

References

Ogre 1.4.0 RC2 SDK Installation Instructions

This installation approach is for users of Ogre with MinGW and MSYS.

1. install MinGW and MSYS as explained here

2. follow this guide for installing Ogre x.x.x SDK for Code::Blocks + MingW, except for:

  • Ignore the Code::Blocks stuff if you like
  • Yes, the DirectX SDK is necessary (for debugging Ogre programs)! Download from the link in the wiki, check the file size, it should be > 500 MB.
  • Yes, the MinGW ToolBox is necessary!

3. compile with:

COMPILE_OPTIONS = '-mthreads -fmessage-length=0 -fexceptions -fident'
INCLUDE_OPTIONS = '-Ic:/OgreSDK/include'
LINK_OPTIONS    = '-Wl,--enable-auto-image-base -Wl,--add-stdcall-alias'
LIBRARY_OPTIONS = '-Lc:/OgreSDK/bin/release -lOIS -lOgreMain'

4. copy executable to 'c:/OgreSDK/bin/release'

5. check 'c:/bin/release/resources.cfg' and add to '[General]':

FileSystem=.

6. run executable

Running Ogre Applications in win32 Vim

This example maps <Leader>r to starting the program 'program.exe' in C:\OgreSDK\bin\release:

:map <Leader>r :silent !cmd /c "start /dC:\OgreSDK\bin\release program"<cr>

Or using UTL:

// <URL:vimscript:map %3cLeader%3er :silent !cmd /c
"start /dC:\OgreSDK\bin\release program"%3ccr%3e>

(join the two lines to a single line)

Sample Ogre SConstruct file

env=Environment()

overlayapp=env.Program(['example.cpp', 'exampleframelistener.cpp', 'application.cpp'],
  LIBS=['OIS', 'OgreMain'], LIBPATH='c:/OgreSDK/bin/release', CPPPATH='c:/OgreSDK/include')

env.Install('c:/OgreSDK/bin/release', overlayapp)
env.Alias('install', 'c:/OgreSDK/bin/release')

Sample Ogre Rakefile

You can use this Rakefile for Ogre projects. Be sure to change the OPTIONS and DEPENDENCIES:

require 'rake/clean'

# DEPENDENCIES ---------------------------------------------------------------
file 'exampleframelistener.o'  => ['exampleframelistener.h', 'exampleframelistener.cpp']
file 'application.o'           => ['application.h', 'exampleframelistener.h', 'application.cpp']
file 'template.o'              => ['template.cpp']

# OPTIONS --------------------------------------------------------------------
OUTPUT_DIR      = 'c:\OgreSDK\bin\release'
OUTPUT_APP      = 'template.exe'

COMPILE_OPTIONS = '-mthreads -fmessage-length=0 -fexceptions -fident'
INCLUDE_OPTIONS = '-Ic:/OgreSDK/include'
LINK_OPTIONS    = '-Wl,--enable-auto-image-base -Wl,--add-stdcall-alias'
LIBRARY_OPTIONS = '-Lc:/OgreSDK/bin/release -lOIS -lOgreMain'

# FILE LISTS -----------------------------------------------------------------
SRC = FileList['*.cpp']
OBJ = SRC.ext('o')
CLEAN.include OBJ
CLOBBER.include OUTPUT_APP

# TASKS ----------------------------------------------------------------------
desc 'Build application.'
task :default => [OUTPUT_APP] # do this if no task was specified

desc 'Run application.'
task :run => [OUTPUT_APP] do
    sh "cd #{OUTPUT_DIR} && #{OUTPUT_APP}"
end

# COMPILING ------------------------------------------------------------------
rule '.o' => '.cpp' do |t| # rule: object files are made from source files
    sh "g++ #{INCLUDE_OPTIONS} #{COMPILE_OPTIONS} -c -o #{t.name} #{t.source}"
end

# LINKING --------------------------------------------------------------------
file OUTPUT_APP => OBJ do |target|
    sh "g++ #{LINK_OPTIONS} #{LIBRARY_OPTIONS} #{OBJ} -o #{target}"
    cp target.name, OUTPUT_DIR
end

Using Ogre with Blender

1. Download and install Ogre 'Command-line Tools vx.x.x'

2. Download Ogre 'Blender Mesh & Animation Exporter vx.x.x'. Copy .py-file to [blender install dir]\.blender\scripts

3. Change line in .py-file:

OGRE_XML_CONVERTER = 'c:\\OgreCommandLineTools\\OgreXmlConverter.exe'

Physics Engine

Most people use Newton Game Dynamics, but I'll try ODE, because it is open source.

Sound Engine

I'm not sure here, but OpenAL seems to be the standard, or perhaps Open Source Audio Library Project.

Personal tools