Jump to content
Xtreme .Net Talk

pseud0

Members
  • Posts

    2
  • Joined

  • Last visited

pseud0's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. First off: Wow! This is really cool. You the man Wyrd! Exactly what one need to just fire away with a new project. Well, as an esteemed n00bie, I naturally ran my head in the wall. Is it possible to utilize Phoenix in an application that has a Windows.Form as the main entrypoint? I tried to change the "main" in your example into a constructor that takes the form as an argument. And then set the variables for that form. But on execution the application doesn't appear at all. I want to use the Form application as the main entrypoint in order to utilize windows graphical components such as MessageBox and different dialogs. My application basically has a map layer with objects bound to it. By clicking an object I want a windows gui dialog to appear with object information (house, intersection, water, blah blah). But I still want to use DirectDraw for drawing the map. (am I making any sense here???) Code example: public Form1 () { [indent]InitializeComponent(); Map m = new Map(this); [/indent] } ... and in Map: Map(Form window) { [indent] window.WindowState = FormWindowState.Maximized; window.FormBorderStyle = FormBorderStyle.None; window.Show(); // Start the game. this.Start(window); //Cleanup. this.Dispose(); [/indent] } In the example above the application just fails. And if I set the Game (ie: Map-class) as the startup project then for some reason I cant use MessageBox() since: 'System.Windows.Forms.MessageBox' denotes a 'class' which is not valid in the given context I'm so sorry for all the trouble, I wish I wasn't such a newbie. :(
  2. Ok, So I'm new to DirectDraw. Been working a lot with GapiDraw (for PocketPC) previously. With Gapi you can use DrawFast on a surface with negative values if you've set a clipper to the surface, but when I use negative X and Y coords for the DDraw DrawFast it's a crash and burn. How do I get around this? Example: private void InizializeDirectDraw() { [indent]... device = new Device(); ... primarySurface = new Surface( desc, device ); ... clipper = new Clipper( device ); clipper.Window = this; primarySurface.Clipper = clipper; ... // draw a new blue (default it seems) bitmap imageSurface = new Surface( new Bitmap(100,100), desc, device ); [/indent] } // called every 30 ms from a timer private void Render() { [indent]... [color=Red]secondarySurface.DrawFast( 0, 0, imageSurface, DrawFastFlags.Wait );[/color] ... [/indent] } Now... If I change the secondarySurface.DrawFast(0, 0, imageSurface, DrawFastFlasgs.Wait); to say; secondarySurface.DrawFast(-10, -10, imageSurface, DrawFastFlasgs.Wait); then the program crashes on rendering the surface. How do I get around this? Is there a problem with the clipper? I'm happy for ANY help or suggestions. It seems hard to believe that noone has every drawn anything off the left of the screen, but I can't find any information on it at all. :( Thanks!
×
×
  • Create New...