|
Notes for upgrading from G3D 6.xx to 7.xx:
New Widget/GEvent delivery
The event system now maintains a ranking of all GModules. The module at the top of the ranking may optionally have "focus", which is a useful concept for 2D gui elements. Modules are rendered in the opposite of the event delivery order, so that for 2D rendering the highest priority module appears on top. The 6.xx priority system for event delivery has been removed entirely.
include structure changes
Most programs should now have include <G3D/G3DAll.h>. This is because the directory structure has changed for header files from 6.xx. The goal of the change was to bring G3D into line with other OS X and Linux libraries and to help with integration with 3rd party libraries like ODE. This new structure should allow easier porting of applications between operating systems. The new directory structure for headers is:
include
G3D/
G3D.h
G3DAll.h
GLG3D/
GLG3D.h
GL/
gl.h
zlib.h
png.h
jpeglib.h
WinMain
Win32 programs must call the macro G3D_START_AT_MAIN(); at top-level (e.g., right before defining your main function), if they do not define WinMain themselves. G3D_START_AT_MAIN() does nothing on other programs, so it is safe to always add this to the file in which you defined main.
GApp changes
A number of changes have been made to GApp. Most notable - onGraphics now takes three arguments: onGraphics(RenderDevice* rd, Array<PosedModelRef> &posed3D, Array<PosedModel2DRef> &posed2D).
Similarly important is the removal of GApplet support. Programs that were defined with a parallel structure using GApplets should be restructured. See the chopper network demo for an example of how to set up an Applet-like structure for programs where you may be having trouble making the switch.
DebugController and DebugCamera have been renamed DefaultController and DefaultCamera.
A number of fields that defined debug behavior are more easily accessible, as part of the GApp class; for example, showRenderingStats and showDebugText.
Other behaviors are definable in a similar fashion, such as escapeKeyAction, which is an enumerated type (Action) and can be set to Action::ACTION_NONE, Action::ACTION_QUIT, or Action::ACTION_SHOW_CONSOLE.
SDLK_ is gone
G3D 7.00 replaced SDL event types with G3D event types. The change affecting the most users is that SDLK_* is now GKey::*. Other changes include KMOD_* to GKEYMOD_*.
Accessors (functions with "get" in the name)
All 6.xx functions with "get" in the name that accepted no arguments were renamed to just the part of the name after "get". Example: G3D::CoordinateFrame::getLookVector is now G3D::CoordinateFrame::lookVector You will see errors like: error C2039: 'getLookVector' : is not a member of 'CoordinateFrame'
GApp::main now returns int
You will see errors like the following, indicating that you need to upgrade your code: error C2555: 'Appmain': overriding virtual function return type differs and is not covariant from 'G3DGApp::main'
Can't find X11/Xlib.h
Delete your ~/.icompile file; the newest version of iCompile (0.5.0) is not compatible with the old files.
G3D::GCamera::project now returns the depth buffer value and not -1/z in the z-component.
ALL CAPS Vector, Color, Matrix constants
The all-caps constants have been renamed to lower-case static functions. Example: G3D::Color3::RED is now G3D::Color3::red(). You will see errors like: error C2039: 'WHITE' : is not a member of 'Color3'
G3D::NetMessage is gone
G3D::ReliableConduit::send, G3D::ReliableConduit::receive, G3D::LightweightConduit::send, and G3D::LightweightConduit::receive now accept any class that has serialize and deserialize methods. There is no need for a NetMessage base class. To replace this now unnecessary base class, you can add the following to your program:
namespace G3D { class NetMessage { public: virtual ~NetMessage(); };}
Network send with no arguments is gone
You must now send at least a message type; you cannot send a message with no content.
GApplet methods not called/compile time errors
The names of the GApplet methods changed, e.g., from "doGraphics" to "onGraphics". The old method names have been configured to create compile time errors to help you catch bugs. These will appear as:
error C2555: 'BrowsedoGraphics' : overriding virtual function differs from 'G3DGApplet::doGraphics' only by return type or calling convention
SDL event codes replaced with G3D ones
For example, SDL_QUIT is now GEventType::QUIT. This may produce errors in your code like:
error C2065: 'SDL_QUIT' : undeclared identifier
Renamings
Switched from MBCS to UNICODE on Win32
The default wide character set for Visual Studio 2005 is Unicode (instead of multi-byte, which is what previous versions used.)
The G3D source code now compiles under either character set, however the precompiled binaries distributed for Windows are now Unicode binaries. This eliminates the project configuration step when users are creating new projects on Windows since G3D matches the default.
However, this means that pre-existing visual studio projects will likely encounter string errors at link time. If they do, in the Visual Studio IDE go to Projects...Property Pages and on the Configuration Properties... General tab, change Character Set to be "Use Unicode Character Set."
GApp::debugController is now a reference
This means that app->debugController.setActive etc. calls are now app->debugController->setActive.
c: files visual studio\vc98\include\winsock2.h(99) : error C2011: 'fd_set' : 'struct' type redefinition
G3D (since 6.09) uses WinSock 2.0 on Windows. Unfortunately, this is incompatible with WinSock 1.1, which is included by windows.h. So you have to EITHER:
PhysicsFrame::integrate is gone
These functions have been removed to avoid ambiguity. The old implementations were:
PhysicsFrame PhysicsFrame::integrate(
float t,
const PhysicsFrame& dx) {
PhysicsFrame result;
result.translation = translation + t * dx.translation;
result.rotation = rotation * dx.rotation.pow(t);
return result;
}
PhysicsFrame PhysicsFrame::integrate(
float t,
const PhysicsFrame& dx,
const PhysicsFrame& ddx) {
PhysicsFrame result;
result.translation = translation + t * dx.translation + t * t * ddx.translation;
result.rotation = rotation * dx.rotation.pow(t) * ddx.rotation.pow(t * t);
return result;
}
Generated on Thu Aug 2 11:40:43 2007 for G3D by
1.5.2
Hosted by
|