BahamutZERO
2005.03.24, 12:17 PM
Greetings,
I'm helping a Windows programmer port his game to Mac OS X. The entire engine is cross-platform and written in C++. It outputs indexed textures (paletted), with a palette that can change often since palette animation is used. It's an isometric engine, so no 3D is involved at all.
The game is an RTS, and as such there is both a game an a map editor. Therefore, in the case of the editor, the engine will be drawing to some kind of document window with scrollbars which may be live resized by the user, like any other document window.
Right now, we have an embryonic editor port working using HIView and Quartz to draw. The drawing is done by creating a CGColorSpace for the current palette and creating a new CGImage for every new frame, or when the palette has changed. We rely on Carbon and the render thread to notify the HIView it needs to refresh itself. When the view's bounds change, the engine is notified of a bounds change, at which point a new CGImage is created.
In mild terms, this is god-awfully slow. It works, but takes 75+ % CPU time on a dual processor 1 GHz G4 desktop, and this is no fancy engine with 1K particles flying around.
Thus the question -- what is the best API or technology to use to handle the editor's UI, and incidentally the game itself.
Thank you.
I'm helping a Windows programmer port his game to Mac OS X. The entire engine is cross-platform and written in C++. It outputs indexed textures (paletted), with a palette that can change often since palette animation is used. It's an isometric engine, so no 3D is involved at all.
The game is an RTS, and as such there is both a game an a map editor. Therefore, in the case of the editor, the engine will be drawing to some kind of document window with scrollbars which may be live resized by the user, like any other document window.
Right now, we have an embryonic editor port working using HIView and Quartz to draw. The drawing is done by creating a CGColorSpace for the current palette and creating a new CGImage for every new frame, or when the palette has changed. We rely on Carbon and the render thread to notify the HIView it needs to refresh itself. When the view's bounds change, the engine is notified of a bounds change, at which point a new CGImage is created.
In mild terms, this is god-awfully slow. It works, but takes 75+ % CPU time on a dual processor 1 GHz G4 desktop, and this is no fancy engine with 1K particles flying around.
Thus the question -- what is the best API or technology to use to handle the editor's UI, and incidentally the game itself.
Thank you.