Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: Code technique question: mGDISurface?  (Read 1788 times)

Tegan

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 3
    • View Profile
Code technique question: mGDISurface?
« on: March 16, 2007, 09:46:38 PM »

Hey guys,

I have been working on a terrain and world editor for my game system for a little bit now. I recently ran in to Visual Ogre Studio so I decided to check out the source to see if I was on the right path, and just to take a look at another implementation of an editor using MOGRE. My editor is quite a bit different, and is very much tailored to my game system, it isn't meant to be general purpose like Visual Ogre Studio.

I have a question though. As I was browsing the source, I saw you guys are creating a bitmap object in the OgreView class and invalidating it. It never seems to have anything drawn to it, it just seems like a transparent overlay. What is this being used for if I might ask? I am curious because it seems like it might be some kind of GDI black magic trick, but I'm just not grasping whats going on there. I was under the impression that the Invalidate() call to the control would cause the window itself to repaint, so whats the point of drawing and invalidating a GDI surface?

Anyways, so far your editor is shaping up real nice. Unfortunately it wouldn't currently work for what I am doing with my project, but I think it has potential to become a great general scene editing tool.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2653
    • View Profile
    • http://www.wreckedgames.com
Code technique question: mGDISurface?
« Reply #1 on: March 17, 2007, 06:07:57 AM »

The bitmap is used for drawing a selection box. At first, we were using Ogre overlays, but that meant they would show up on other viewports. Then, we tried .Net controls for drawing a selection box. However, in the end, to avoid really horrible flicker, we decided to use a bitmap to quickly blit a selection box.

However, I believe we were eventually planning to use Ogre to draw 3d lines instead of the bitmap. But, not much has been worked on in a little while.

Anyway, thanks for the encouragement :)
Logged

Tegan

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 3
    • View Profile
Code technique question: mGDISurface?
« Reply #2 on: March 22, 2007, 08:00:35 PM »

Ahhh, makes perfect sense now that you explain it. Thanks :D I plan to do selection more like NWN2, which I think you stated you will as well. Basically a 3D cube drawn around the object.
Logged