C++ :: DirectX - How To Put Outline Around Bounding Box
Feb 21, 2014
For a 2d platform game. As title says. I want to see the bounding box that I have created to work with de-bugging, I have the bounding box set to the edges of my sprites to use with collision. How do I show the outline of the bounding box?
View 1 Replies
Jul 8, 2013
I am trying to draw a shape or font on dialog and then fill the outline. I have 2 buttons on this 2 buttons I have the following code
Code:
case IDC_BUTTON1:
MessageBox(hDlg, L"Start Drawing!!", L"ButtonPressed", MB_OK | MB_ICONEXCLAMATION);
hDC = GetDC(hDlg);
brush = CreateSolidBrush(RGB(128, 128, 128));
SelectObject(hDC, brush);
[code].....
When I remove the BeginPath() and EndPath() functions my lines are being drawn. But when I insert this BeginPath() and EndPath() and StrokeAndFillPath(hDC); the nothing is being drawn.
Why it is not doing as per the expectations. I want to draw a shape for example A with a outline. And i want it to be closed when drawing is ended and filled the hollow portion.
What am I doing wrong in this ?I am not implementing it in WM_PAINT but drawing is done in WM_LBUTTONUP.
View 6 Replies
View Related
Feb 6, 2014
I am because I don't know what to use OpenGL or DirectX? I heard some people saying I can use both. How is this? What is better for online games? And when I choose I will need some tutorials too ....
View 1 Replies
View Related
Feb 13, 2013
So a long time ago I messed around with DirectX but I don't remember where it gets placed by default. I want to just get rid of the SDK and get the up to date version of it.
View 4 Replies
View Related
May 27, 2013
I have a problem with implementing Shadow Mapping into a project I am working on. I am very much new to shaders and I have been given a Shadow Mapping shader to implement and understand. I have mostly got my head round the concept and the code but I can't figure out why its not working.
As I understand it the main steps to follow are;
1) Render the scene from the POV of the light - this is done in ShadowMap::SetUpDepthRender where the view and projection matrices are passed to the shader.
2) Render all objects in the scene - this creates a shadowmap (depth map) via the shader.
3) Reset the view and projection matrices to that of the camera - done in ShadowMap::SetUpSceneRender.
4) Render the scene objects once more appling the depth map to them via the second pass of the shader.
The problem Im having is that I have a stripe of light running diagonally across the screen. It passes through the point of the spotlight that I am mapping for. I believe this is the shadowmap being applied to the scene however I could be wrong?
Below is the code in the ShadowMap class used for setting the fx file.
LPDIRECT3DSURFACE9 oldDepthSurface = NULL;
LPDIRECT3DSURFACE9 oldRenderTarget = NULL;
ShadowMap::ShadowMap(void) {
//Create our Light
Vector3D lightPosition(20.0f, 2.9f, 10.0f);
Vector3D lightDirection;
[Code] .....
View 2 Replies
View Related
Dec 12, 2013
I do this because I want to transform the .x format into xml... The "frame" data structure can contain other frames, and a name for the frame and a transformation. For example:
Code:
struct frame {
std::string name;
Matrix transform;
std::vector<struct frame> child;
std::vector<struct frame> sibling;
[Code] ....
I know the above won't compile. But am I on the right track to implement data structures this way using linked lists? about directx, I'd like to ask is the .x format implemented with a tree structure rather than linked lists.
View 1 Replies
View Related
Aug 9, 2014
I am trying to make a grid in DirectX, but I keep getting the error "Access violation writing location" for some reason.
This is my code for defining the grid:
void CDirectXFramework::DefineGrid(int Rows, int Cols, float dx, float dz, const D3DXVECTOR3& center) {
/* precalculations */
int CellRows = Rows - 1;
int CellCols = Cols - 1;
float width = (float)CellCols * dx;
[Code]...
What does it look like the problem might be?
btw, the values I am using are:
Rows = 100;
Cols = 100;
dx = 1.0f;
dz = 1.0f;
center = D3DXVECTOR3(0.0f, 0.0f, 0.0f);
I found that the program works when using these values for the rows and columns:
Rows = 2;
Cols = 2;
Using any other value gives the error mentioned above. It displays a small flat surface where I want it to, but I am trying to have a large enough surface to use as a ground (like 100 x 100).
View 5 Replies
View Related
Nov 21, 2012
I am working on a project in which we capture a video using DirectShow samples. I want to know whether it is possible to capture a video with No noise, No interference etc. in other words, we want to capture High Quality (HD) video using DirectShow.
Is there any sample defined in DirectShow using which we can capture HD video.
View 4 Replies
View Related
Jan 20, 2014
Goal: I want to use cygwin g++ to write DirectX applications.
I know that one of the mingw packages contain directx libraries.
Now that I have installed cygwin, can I use directx also?
BTW, does netbeans open a mingw project using cygwin tool chain?
View 5 Replies
View Related