directx

DirectX Game hook

僤鯓⒐⒋嵵緔 提交于 2019-12-03 14:38:29
I'm trying to simulate mouse events in a game. The games uses DirectInput so you can't use SendMessage to send mouse events/keyboard events to it, that's basically why I have to hook in to the game. Also I don't want to use SendInput/mouse_events, the game must run on the background and make mouse events. I already managed to make a DLL hook in the game but now the next problem is that I have to make the mouse events and keyboards (probably the main problem). Thanks in advance. Instead of hooking into the game you could use GlovePIE , which is a kernel-level input emulator. You can write down

FFMPEG Frame to DirectX Surface

ⅰ亾dé卋堺 提交于 2019-12-03 14:06:48
问题 Given a pointer to an AVFrame from FFMPEG's avcodec_decode_video () function how do I copy the image to a DirectX surface? (Assume I have a pointer to an appropriately sized DX X8R8G8B8 surface.) Thanks. John. 回答1: You can use FFMPEG's img_convert() function to simultaneously copy the image to your surface and convert it to RGB format. Here's a few lines of code pasted from a recent project of mine which did a similar thing (although I was using SDL instead of DirectX): AVFrame *frame;

Matrix multiplication - view/projection, world/projection, etc

拜拜、爱过 提交于 2019-12-03 13:48:19
问题 In HLSL there's a lot of matrix multiplication and while I understand how and where to use them I'm not sure about how they are derived or what their actual goals are. So I was wondering if there was a resource online that explains this, I'm particularly curious about what is the purpose behind multiplying a world matrix by a view matrix and a world+view matrix by a projection matrix. 回答1: You can get some info, from a mathematical viewpoint, on this wikipedia article or on msdn. Essentially,

OpenGL or Direct3D for a new Windows game project? Or something else?

夙愿已清 提交于 2019-12-03 12:57:49
I'm starting a hobby game project on Windows that will make heavy use of 3D graphics effects. It will most likely be written in C++. Should I use OpenGL or Direct3D for my graphics backend? Why? Or should I use a ready-made graphics engine such as OGRE 3D ? Which one? Some "how to get started" links would be useful. (On either technology, or both.) Edit - Yes I really meant Direct3D, not DirectX, thanks to graham.reeds for clarification Edit - Mihai Lazar pointed out that I could also use a graphics engine such OGRE 3D. Edited the question to reflect this alternative. Start with OpenGL because

How do I balance script-oriented OpenType features with other OpenType features using DirectWrite?

孤人 提交于 2019-12-03 12:36:29
问题 Full disclosure: I'm working on my libui GUI framework's text API. This wraps DirectWrite on Windows, Core Text on OS X, and Pango (which uses HarfBuzz for OpenType shaping) on other Unixes. One of the text formatting attributes I want to specify is a collection of OpenType features to use, which all three provide; DirectWrite's is IDWriteTypography . Now, when you draw some text with these libraries, by default you'll get a few useful OpenType features enabled, such as the standard ligatures

Why does OpenGL be designed as a state machine originally? [closed]

风格不统一 提交于 2019-12-03 12:27:31
During my OpenGL experience, I often forgot to set some states. So I think state machine may not be a good design today. But now it has to be compatible. And I also know that DirectX was also a state machine in the early days. I'd like to know why OpenGL as well as DirectX was originally designed as a state machine? It's not clear what people mean when they refer to "state machine", as they never explain what the opposite is. So I'll talk about it both generally and specifically in terms of OpenGL "state machine" vs. current D3D "not a state machine". Both OpenGL and Direct3D use global state.

Why not use GDI to repeatedly fill a window with RGB data from an array?

寵の児 提交于 2019-12-03 11:31:06
问题 This is a follow-up to this question. I'm currently writing a simple game and am looking for the fastest way to (repeatedly) display an array of RGB data in a Win32 window, without flickering or other artifacts. Several different approaches were recommended in the answers to the previous question, but there was no consensus on which would be the fastest. So, I threw together a test program. The code simply displays a framebuffer on the screen repeatedly, as fast as possible. These are the

How to implement a voice changer?

痴心易碎 提交于 2019-12-03 10:20:04
问题 I want to write a app which change the microphone input voice and make it like robot or some funny man's voice.It must support send changed voice to all application like IM Software or Game Client. Which technology should I pick up? Windows WaveForm Api? DirectX? audio driver? Thank you very much! 回答1: There's an MSDN Coding4Fun article that explains how to create a voice changer that operates over Skype, in C# (.NET). The full source code is also hosted as a project on CodePlex. In addition,

Missing files, DirectX SDK (d3dx9.lib, d3dx9.h)

走远了吗. 提交于 2019-12-03 09:32:34
问题 I installed the DirectX SDK June 10 , but when I include the d3dx9.h , the compiler can't find it. I checked the SDK directory, and I didn't find it there either. files missing: d3dx9.lib , d3dx9.h , dxfile.h . 回答1: The DirectX SDK installation will add a system environment variable DXSDK_DIR that holds the path to wherever the SDK was installed to. Instead of inserting an absolute path in your Include and Library Directories, I'd recommend using this variable to set the Include and Library

C# and Arrow Keys

蓝咒 提交于 2019-12-03 09:19:21
问题 I am new to C# and am doing some work in an existing application. I have a DirectX viewport that has components in it that I want to be able to position using arrow keys. Currently I am overriding ProcessCmdKey and catching arrow input and send an OnKeyPress event. This works, but I want to be able to use modifiers( ALT + CTRL + SHIFT ). As soon as I am holding a modifier and press an arrow no events are triggered that I am listening to. Does anyone have any ideas or suggestions on where I