Jump to content
Xtreme .Net Talk

Lycaon

Members
  • Posts

    6
  • Joined

  • Last visited

Lycaon's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I'm trying to enable my engine to start up in windowed or fullscreen mode mased on the initialize call... Fullscreen works great, when I draw something at 0,0 it shows up in the upper left corner as intended... If I start up in windowed mode, and draw to 0,0 the image is still drawn to 0,0 on my screen, even if my window is at, say 200,200... I literally have to move the window up to the upper left corner of my screen to see the drawn image. Basically everything is drawn as if the app IS in fullscreen, even when the window is in a different position. I'm not sure where I went wrong. Here's the code I've got for initialization. Public Sub Initialize(f as Form, Windowed As Boolean) m_VideoDevice = New DirectDraw.Device(DirectDraw.CreateFlags.Default) If Windowed Then f.FormBorderStyle = FormBorderStyle.FixedToolWindow m_VideoDevice.SetCooperativeLevel(f, DirectDraw.CooperativeLevelFlags.Normal) Else f.FormBorderStyle = FormBorderStyle.None m_VideoDevice.SetCooperativeLevel(f, DirectDraw.CooperativeLevelFlags.FullscreenExclusive) m_VideoDevice.SetDisplayMode(1024, 768, 16, 60, True) End If Dim Caps As New DirectDraw.SurfaceCaps() Dim surfBack, surfFront As DirectDraw.SurfaceDescription Caps.PrimarySurface = True surfFront = New DirectDraw.SurfaceDescription(Caps) Primary = New DirectDraw.Surface(surfFront, m_VideoDevice) Primary.Clipper = New DirectDraw.Clipper(m_VideoDevice) Primary.Clipper.Window = f Caps.Clear() Caps.OffScreenPlain = True 'Caps.SystemMemory = True <-- drops my fps by 75% (yuck) surfBack = New DirectDraw.SurfaceDescription(Caps) surfBack.Width = f.Width surfBack.Height = f.Height f.Show() Backbuffer = New DirectDraw.Surface(surfBack, m_VideoDevice) LoadResources() End Sub On a side note, I remember using .Flip back in VB + DX7... Would it be better here performance-wise? I got this code from createdbyx.com, the rendering is all done with the following (after the .Draw calls): objDestRect = New Rectangle(0, 0, 1024, 768) Primary.Draw(objDestRect, Backbuffer, DirectDraw.DrawFlags.Wait) Last, createdbyx has a windowed example on his site that works perfectly with a picturebox. As a test, I removed the picturebox and changed the code to directly draw to the form. Still worked perfect, with no need to offset x/y... Yet when I take that working initialization code and throw it in my engine class (after updating variable names), doesn't work :\ Forgive any errors in the code, I had the subs separated out into separate subs for windowed and fullscreen and just reconstructed my original sub that used a boolean to choose between the two (since I have no problem with fullscreen). Thanks in advance, Lyc
  2. I'm messing around with DX9c + VB.NET 2005, and am fishing around for the best (as in most efficient) way to implement a custom GUI in a fullscreen DirectX game. The drawing isn't much of a problem, though currently ugly visually, I have an ObjectManager class that holds all the windows (and other game objects that need to be drawn) and each window has it's own control collection to handle labels, textboxes, etc. What I'm looking for is a decent way to add in mouse / keyboard events. I'm using DirectInput to handle them at the moment, however, I'm not sure how to go about 'redirecting' input to the topmost form that I've got drawn over the game GUI, and of course, that means I've got no clue how to do anything as involved as events... So... Any suggestions? :)
  3. Anyone happen to know what I'd need to do to enable my program to detect/catch/hook clicks in IE (and possibly other browsers) and then handle the click action myself? I'm interested in making my own download manager, and the ability to detect file downloads in the browser, then handle the downloads myself, would make a great addition to my program. Any pointers?
  4. Barry, I ran into the exact same problem with Beta 2. I tried repairing, which failed. I eventually uninstalled and reinstalled it, and everything has worked just fine since then. I'd give that a try and see how it goes. Standard solution for stuff Microsoft distributes (hehe).
  5. Thanks for replying, but I realized I may not have been clear enough in my previous post. I was wondering if it were possible to receive data *below* the IP layer.
  6. I am familiarizing myself with a bunch of different RFCs, and at the moment have a decent DHCP server programmed... One of the things a good server does is send ARP broadcasts to potential addresses to make sure that no other machine uses them. Long story short, VB.NET doesn't naitively support ARP and at the moment I'd rather not use the iphelper API. I've seen you can specify RAW for both the protocol type and the socket type, however, I've never been able to get it to send (or recieve) raw packets (meaning I want the entire header, etc. which is 'under' the IP layer, and thus, apparently inaccessible to .NET's sockets) Is there any way at all to recieve (or send) my own raw packets in .NET?
×
×
  • Create New...