Jump to content

  • Log In with Google      Sign In   
  • Create Account

Dave

Member Since 22 Mar 2004
Offline Last Active Yesterday, 07:43 AM

Topics I've Started

C# Custom Popup for DropDown.

11 December 2012 - 07:56 AM

Afternoon,

I've googled and googled and found no solid answers on how to do this.

I basically want to provide a my own drop down selector control for the DropDown control. Failing that being possible i'll happily write my own usercontrol for this, that however led me on a complicated path for how to do your own popup functionality at all in .net with C#. The use-case is a dropdown that allows you to select an image from a pallette of images rather than just a list of file/image names. I also want to be able to filter the contents of the dropdown listview/image pallette differently to the standard way that the C# DropDown does it.

I have found the .net Popup class, it works but you're unable to assign a UserControl to the child field and so i won't be able to popup my more complicated palette view.

I have also seen solutions where a ToolStripDropDown was used, but that didn't allow me filter the contents of the view by typing in the textbox above it.

The solution i have at the moment is to fake it with a separate form but i get all sorts of issues to do with managing when it should be shown and hidden based on the focus states of the control that spawned it etc. Also, if i spawn it and then move the main application window it then ofcourse gets left behind.


Has anyone here managed this?

Thanks,

IMGUI

28 November 2012 - 05:35 PM

I post here because the forums at Molly Rocket seem more dead than tank tops.

I'm looking into this for a second time and i really can't decide whether:

a) Everything i want to do with it is possible.
b) It's actually any more simple than a well written RMGUI.


To those of you here that have written a decent IMGUI, or have atleast attempted one, i'd like to know how you:

a) Implemented modal dialogs.
b) Implemented draggable windows.
c) How did you identify a control between frames? I don't think the user passing an ID in to each Do*() method is an acceptable solution.
d) Do you have a designer for it or is it all hand coded? In most cases not having a designer is not acceptable.
e) Did you notice any performance issues when doing multiple passes over the UI code. It has been suggested that to solve the modal problem you need to do an examination pass before the input pass in order to detect ahead of time that something is modal.
f) Did you find any performance issues with alot of widgets?
g) How did you persist state between frames?

It also appears that the Unity 3D Editor is written entirely in an IMGUI and it's certainly pretty complex and this is encouraging however im not sure i believe it to be true yet as running fraps gives a framerate only for the game window. Not sure why the rest of the Unity Editor ui doesnt have a framerate if it is indeed immediate.

IMGUI or RMGUI guys, i don't see the answer yet, what's your take?


Quick Unity and Blender Question

23 November 2012 - 05:59 PM

Does anybody know what tech their editor GUIs are using? Google results seem to indicate that both are IMGUI solutions, however given how complex they are i'm wondering if this is actually the case. Does anyone know if this is true?

Basic FPS Physics Part 2

12 July 2010 - 01:10 AM

So, more physics stuff for FPS games!

If i want to intersect the walls and floor with the player how do i do it? Most of this i believe i have worked out. I don't use a physics volume at the moment, i cast 5 rays, forward, backward, left, right and down. When i walk and jump around in open space, on a piece of floor terrain it all works fine. I cast the rays and the downard ray is the only one that intersects and has an intersection point within range. The normal comes back as (0,1,0), i dot this with the velocity for the frame which is straight down for gravity and the normal cancels out the downward movement.

But how do we combine intersections with walls? If i walk forward and hit a wall that has a surface normal of (0,0,-1), and i also have the intersect with the floor, should i combine these normals to give me (0, 0.707, 0.707) and then resolve the velocity using the dot product? I have tried this and it causes the player to drop through the floor slowly (because the gravity direction dotted with the accumulated normal gives a slight downards motion.

Do we run the floor intersection and surroundings intersection in two distinct passes, or can we combine them as described above?

Thanks,

SlimDX: Device.VertexDeclaration

03 July 2010 - 09:12 AM

Evening,

My C# app is running out of memory and after hunting it down i discovered that it was where i was doing the following:

			SlimDX.Direct3D9.VertexDeclaration Declaration = new SlimDX.Direct3D9.VertexDeclaration(Render.Device, Elements);

SlimDX.Matrix WVP;

WVP = SlimDX.Matrix.Identity;
WVP = SlimDX.Matrix.Multiply(WVP, m_Transform);
WVP = SlimDX.Matrix.Multiply(WVP, Render.Camera.ViewTransform);
WVP = SlimDX.Matrix.Multiply(WVP, Render.Camera.ProjectionTransform);

Effect.SetValue(new SlimDX.Direct3D9.EffectHandle("matWorldViewProjection"), WVP.ToArray());
Effect.SetValue(new SlimDX.Direct3D9.EffectHandle("bOverrideColour"), m_bOverrideColour);
Effect.SetValue(new SlimDX.Direct3D9.EffectHandle("OverrideColour"), m_OverrideColour);
Effect.CommitChanges();
Render.Device.VertexDeclaration = Declaration;
Render.Device.DrawUserPrimitives(SlimDX.Direct3D9.PrimitiveType.LineList, 1, Verts);

Declaration.Dispose();


I know that creating vertex declarations on the fly is not wise, this is temporary code. Now, the leak occurs when i don't manually Dispose() of the vertex declaration.

I bring this up for 3 reasons:

1) I am now a bit confused about when i should Dispose() manually and when i shouldn't. My impression was that if i know i dont need it any more and want it cleaned up, i Dispose() it. Otherwise the GC does it. Is this correct?

2) I thought there is a chance that this is a bug in SlimDX, though i doubt it.

3) There is a documentation error for Direct3D9.Device.VertexDeclaration. It states that a Result is returned when it's a property.

Thanks guys,

PARTNERS