Click here to Skip to main content
15,914,820 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Dynamic arrays Pin
Joe Woodbury17-Apr-06 21:21
professionalJoe Woodbury17-Apr-06 21:21 
QuestionImpersonation and Access Rights Pin
Putta_V17-Apr-06 5:28
Putta_V17-Apr-06 5:28 
QuestionLinker Error ?? Pin
jinbabaj17-Apr-06 5:03
jinbabaj17-Apr-06 5:03 
AnswerRe: Linker Error ?? Pin
David Crow17-Apr-06 5:11
David Crow17-Apr-06 5:11 
GeneralRe: Linker Error ?? Pin
jinbabaj17-Apr-06 16:08
jinbabaj17-Apr-06 16:08 
GeneralRe: Linker Error ?? Pin
David Crow18-Apr-06 3:11
David Crow18-Apr-06 3:11 
GeneralRe: Linker Error ?? Pin
jinbabaj17-Apr-06 16:15
jinbabaj17-Apr-06 16:15 
QuestionD3D 2D Texture(PNG File) How to set ColorKey Pin
akira3217-Apr-06 4:24
akira3217-Apr-06 4:24 
D3D 2D Texture(PNG File) How to set ColorKey
I have a PNG(or TGA or DDS) file,I want to create a texture with ColorKey dependendts on PNG's transparent color.

BOOL DoInit()
{
D3DPRESENT_PARAMETERS d3dpp;
D3DDISPLAYMODE d3ddm;
BYTE *Ptr;

#define PNG_WIDTH 256.0f
#define PNG_HEIGHT 256.0f

sVertex Verts[4] = {
{ 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f },
{ PNG_WIDTH, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f },
{ 00.0f, PNG_HEIGHT, 1.0f, 1.0f, 0.0f, 1.0f },
{ PNG_WIDTH, PNG_HEIGHT, 1.0f, 1.0f, 1.0f, 1.0f }
};

// Do a windowed mode initialization of Direct3D
if((g_pD3D = Direct3DCreate8(D3D_SDK_VERSION)) == NULL)
return FALSE;
if(FAILED(g_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm)))
return FALSE;
ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferFormat = d3ddm.Format;
d3dpp.EnableAutoDepthStencil = FALSE;
if(FAILED(g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, g_hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp, &g_pD3DDevice)))
return FALSE;

// Create the vertex buffer and set data
g_pD3DDevice->CreateVertexBuffer(sizeof(sVertex)*4, 0, VERTEXFVF, D3DPOOL_DEFAULT, &g_pVB);
g_pVB->Lock(0,0, (BYTE**)&Ptr, 0);
memcpy(Ptr, Verts, sizeof(Verts));
g_pVB->Unlock();

// Load the texture map
D3DXCreateTextureFromFile(g_pD3DDevice, "Image1.png", &g_pTexture);

return TRUE;
}
QuestionDirect Show webcam Pin
YaronNir17-Apr-06 4:14
YaronNir17-Apr-06 4:14 
Questionproblem with BroadcastSystemMessage() Pin
ashtwin17-Apr-06 4:01
ashtwin17-Apr-06 4:01 
QuestionRe: problem with BroadcastSystemMessage() Pin
David Crow17-Apr-06 4:18
David Crow17-Apr-06 4:18 
AnswerRe: problem with BroadcastSystemMessage() Pin
ashtwin18-Apr-06 20:58
ashtwin18-Apr-06 20:58 
QuestionDebug Assertion Failed Pin
keerthikaaa17-Apr-06 3:09
keerthikaaa17-Apr-06 3:09 
AnswerRe: Debug Assertion Failed Pin
David Crow17-Apr-06 3:29
David Crow17-Apr-06 3:29 
AnswerRe: Debug Assertion Failed Pin
Stephen Hewitt17-Apr-06 4:24
Stephen Hewitt17-Apr-06 4:24 
Question[Message Deleted] Pin
ddmcr17-Apr-06 2:47
ddmcr17-Apr-06 2:47 
AnswerRe: Display Tooltips for each item in ListCtrl Pin
YaronNir17-Apr-06 4:16
YaronNir17-Apr-06 4:16 
AnswerRe: Display Tooltips for each item in ListCtrl Pin
Michael Dunn17-Apr-06 8:02
sitebuilderMichael Dunn17-Apr-06 8:02 
QuestionSlicing in C++ Pin
Krishnatv17-Apr-06 2:44
Krishnatv17-Apr-06 2:44 
AnswerRe: Slicing in C++ Pin
David Crow17-Apr-06 3:30
David Crow17-Apr-06 3:30 
AnswerRe: Slicing in C++ Pin
Milton Karimbekallil17-Apr-06 5:00
Milton Karimbekallil17-Apr-06 5:00 
GeneralRe: Slicing in C++ Pin
Krishnatv17-Apr-06 19:35
Krishnatv17-Apr-06 19:35 
QuestionNEED HELP Pin
malik20017-Apr-06 2:31
malik20017-Apr-06 2:31 
AnswerRe: NEED HELP Pin
David Crow17-Apr-06 3:31
David Crow17-Apr-06 3:31 
QuestionCan I do this? Pin
ewighell17-Apr-06 2:20
ewighell17-Apr-06 2:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.