Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 19 Aug 2002
Offline Last Active Today, 01:33 AM

Topics I've Started

GUI: Direct3D and clipping child controls

02 March 2007 - 09:40 AM

I'm trying to plan out a GUI system implemented in Direct3D that functions similarly to how Windows handles things, where perhaps the most important feature I'd need to replicate is that child windows are clipped inside their parents client area, whether they're text, other controls, or any 3D object. In Direct3D, the first thing that came to mind was to use the stencil buffer actually *as* it is named -- prepare a rectangular (or in fact any renderable shape) upon which I could render child controls. However I'm worried about deeply nested controls having to paint to the stencil buffer too much (fill rate problems?) There may be some trickery I can figure out with this approach to help solve that. In DirectDraw you could specify a universal clipping rectangle (at least in windowed mode, you pretty much had to do this if you didn't want to accidentally write to the desktop). Does Direct3D have a similar way to specify a universal clipping rectangle for area of the screen?

English: 'doubt' vs. 'question' (Lexical Police Attack!)

21 October 2006 - 11:57 AM

There's a strange trend among people who aren't native English speakers: The use of the noun 'doubt' in place of the noun 'question'. "I have a doubt: How do I install <program>?" That's not a doubt. That's a question. I've never seen native English speakers get these confused. A doubt is a belief that a concept is probably false. A question is a request for more information. You can also use 'question' as a verb, in which case it means basically the same thing as the verb 'doubt'. A friend who works at Microsoft (which employs quite a lot of people who aren't native English speakers) originally pointed this out, and he says that this mix-up happens ALL the time there (it drives him nuts). So, where do people learn this improper usage? Mixing up the dictionary entry for the noun and verb forms? Or are English language courses actually teaching this backwards as well? Occasionally this mix-up comes up on these forums. Has anyone else noticed this?

Buffer Overflows and Stack Direction

03 October 2006 - 06:40 AM

From my understanding, the main way that buffer overflows can lead to code execution is by overwriting the return pointer that's on the stack:
[local variables (buffers go here)][return address][pushed arguments] (previous function's stuff here)

[buffer OVERFLOWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW][pushed arguments](previous function's stuff here)
This is all because "push" moves the stack pointer in the negative direction. What if push moved in the positive direction? buffer overflows would continue forward in the "unused" area and would hit the guard page.
(previous function's stuff here)[pushed arguments][return address][local variables (including buffers)]

(previous function's stuff here)[pushed arguments][return address][local variaBUFFER OVERFLOWWWWWWWWWWWWWWWWWW]
Unfortunately the way the "push" "pop" and "ret" instructions work on x86 machines won't let you do this. There's nothing stopping you from doing everything without using those particular instructions though... Is anyone else familiar with other types of problematic overflows? Does anyone know if there's any advantage to stack 'growing negative' like this (other than by silly convention)? Back in the day, the stack would grow in the opposite direction of the heap so that they could share one large region of memory. In modern applications, the stack is usually COMPLETELY isolated with nothing else around.

Ethics of Decompilers

28 August 2006 - 11:22 AM

Let's pretend for a minute that in the near future, someone completes a multiplatform decompiler which can output C code with a high degree of accuracy. Now, let's say they release the decompiler for free to the general public; anyone can download it, and with some tinkering, can decompile almost everything released to date. What kind of consequences of this would you anticipate? How would this impact software piracy? Cheating? Corporations stealing other games' ideas? It doesn't work... YET... Discuss...

Managed DirectX - Changing Resolution

23 August 2005 - 04:44 PM

Semi-n00b question here: I'd like to change the fullscreen resolution in my game. What's the minimum required procedure for this? A complete device shutdown/recreate? Calling Device.Reset with new PresentParameters doesn't work. Also, I've got Textures, Meshes, Effects, VertexBuffers and IndexBuffers that were created using the current Device. If I have to recreate a Device to switch resolution, do I have to recreate *all* of these? If I have to recreate everything, is there a common pattern used to keep track of what is currently loaded, or do you just make a wrapper class for each Texture, Mesh, Effect, etc, with a Recreate function or something? Also, does anyone know of a non-book Managed DirectX How-To/FAQ/Bible that would answer other questions similar to this? The book I have is actually out of date on a lot of things as of the August SDK. Weird, but true. [Edit] The book I have is the "Managed DirectX Kick Start" one that's pretty much the best I've seen so far. [Edited by - Nypyren on August 23, 2005 11:11:57 PM]