Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


EJH

Member Since 17 Jan 2009
Offline Last Active May 05 2014 08:36 PM

Topics I've Started

Monogame and cross platform multiplayer

07 March 2013 - 12:48 PM

Was looking to port an XNA game over to Monogame to run on Linux / Mac as well. One issue though ... how to do cross platform multiplayer? Currently using Lidgren Network Library but I guess that won't work off Windows. Is there a good way to do cross platform networking?


selling software product keys?

22 September 2012 - 04:45 PM

Can anyone recommend a good API or service where you can sell game product keys online? The game is on Steam, but they permit selling product codes separately on your own website however you wish. Basically looking for a secure and preferably cheap way to sell them.

[C++] Try/Catch Exceptions in DLLs

20 November 2010 - 11:02 AM

Heya. I'm getting some seemingly random crashes (access violations to be exact) in a required DLL to which I do not have the source. Is it possible to try catch exceptions that are thrown in a DLL? Like this:

try
{
// call another DLL here
}
catch(..)
{
// do some general exception handling here
}

Or is there any way to prevent a DLL exception from blowing up your program?

[XNA] Viewport.Project() problem

22 November 2009 - 10:46 AM

I'm rendering both 3D geometry and sprite batches (for text and particles) in several viewports that are smaller than the fullscreen viewport. Problem: The 3D geometry is rendering in the smaller viewports as expected, but Viewport.Project() is giving incorrect values. Thus text and sprite particles appear in the wrong places. Here is the relevant code where I actually Viewport.Project() a position from 3D space to 2D screen space. Anyone see any problems? I'm absolutely sure sure my camera and matrices are correct, because 3D geometry renders in viewports correctly. Just not sure why the ViewPort.Project() is getting problems.
// these are initialized elsewhere
// assume they are correctly setup
GraphicsDeviceManager graphicsDevMgr;
Viewport smallViewPort;



// a simple camera looking at 0,0,0
Vector3 camPosition = new Vector3(10000f, 0f, 0.0f);
Vector3 camLookAt = Vector3.Zero;
Vector3 up = new Vector3(0.0f, 1.0f, 0.0f);
float nearClip =  1000.0f;
float farClip = 100000.0f;
float viewAngle = MathHelper.ToRadians(90f);
float aspectRatio = (float)smallViewPort.Width / (float)smallViewPort.Height;



// save the fullscreen viewport
// change to the small viewport
Viewport oldViewPort = graphicsDevMgr.GraphicsDevice.Viewport;
graphicsDevMgr.GraphicsDevice.Viewport = smallViewPort;



// set up camera matrices for the small viewport
// we are looking at something at 0,0,0
Matrix world = Matrix.CreateTranslation(Vector3.Zero);
Matrix view = Matrix.CreateLookAt(camPosition, camLookAt, up);
Matrix projection = Matrix.CreatePerspectiveFieldOfView(viewAngle, aspectRatio, nearClip, farClip);



// project a position from 3D space to 2D screen coords
// these values are wrong!!!
Vector3 projectedPosition = graphicsDevMgr.GraphicsDevice.Viewport.Project(position, projection, view, world);



I think it may have something to do with SpriteBatch needing something else changed in the GraphicsDeviceManager? [Edited by - EJH on November 22, 2009 8:39:37 PM]

[XNA] user key mapping

20 September 2009 - 01:18 PM

I'm doing custom user key mapping for an XNA PC application. I have a GUI setup with the typical: - list of actions (move forward, back, etc) along with current key/mouse button associated with that action - when the user clicks the box next to the action, the next key/mouse press will become associated with that game action Some specific questions: - How to convert a user's KB/Mouse click to a Keys/Mouse object that can be associated with a game action? - How to save a Key/Mouse button object to a file as a string? - How to load the saved string from file and convert back into a Key or Mouse button when the game loads up next time? Preferably, can you do this without some massive if/else or switch on every key, such as: if(savedString == Key.A) else if(savedString == Keys.B) etc... which would likely break on every non-standard or foreign keyboard anyway?

PARTNERS