Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

142 Neutral

About DavidGallagher1

  • Rank
  1. DavidGallagher1

    find cursor image being used

    Thanks ankhd, but because I'm not manually setting the mouse I can't retrieve it but didn't know about that thanks. what I wanted was for my engine (using 3DWebUI) I wanted to change my sprite (used for navigating the web) based on the windows mouse cursor while it's hidden. GetCursorInfo() wasn't enough as it wouldn't work while hidden but someone was generous enough to share a function that worked.   anyway for anyone else...   load some global cursors... gCursor_Arrow = LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW)); gCursor_Hand = LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND)); gCursor_IBeam = LoadCursor(NULL, MAKEINTRESOURCE(IDC_IBEAM));   function to get the hcursor... HCURSOR GetCurrentCursorHandle() { //-------------------------------------------------------------     POINT pt;     HWND hWnd;     DWORD dwThreadID, dwCurrentThreadID;     HCURSOR hCursor = NULL;     // Find out which window owns the cursor     GetCursorPos(&pt);     hWnd = WindowFromPoint(pt);     // Get the thread ID for the cursor owner.     dwThreadID = GetWindowThreadProcessId(hWnd, NULL);     // Get the thread ID for the current thread     dwCurrentThreadID = GetCurrentThreadId();     // If the cursor owner is not us then we must attach to     // the other thread in so that we can use GetCursor() to     // return the correct hCursor     if (dwCurrentThreadID != dwThreadID) {         // Attach to the thread that owns the cursor         if (AttachThreadInput(dwCurrentThreadID, dwThreadID, TRUE)) {             // Get the handle to the cursor             hCursor = GetCursor();             // Detach from the thread that owns the cursor             AttachThreadInput(dwCurrentThreadID, dwThreadID, FALSE);         }     } else         hCursor = GetCursor();     return hCursor; //------------------------------------------------------------- } in use... if(pWebTexture2D[i].bWebView_Has_Focus) { //--------------------------------------------- //cursor info... HCURSOR hc = GetCurrentCursorHandle(); //change cursor texture... if(pWebTexture2D[i].gCursor != hc) { if(hc == gCursor_Arrow) { iSpriteTextureSet(pWebTexture2D[i].Camera_Sprite_MC,pWebTexture2D[i].Camera_Mouse_Tex2D[0]); } else if(hc == gCursor_Hand) { iSpriteTextureSet(pWebTexture2D[i].Camera_Sprite_MC,pWebTexture2D[i].Camera_Mouse_Tex2D[1]); } else if(hc == gCursor_IBeam) { iSpriteTextureSet(pWebTexture2D[i].Camera_Sprite_MC,pWebTexture2D[i].Camera_Mouse_Tex2D[2]); } pWebTexture2D[i].gCursor = hc; } //...
  2. Just wondering if anyone knows how to find out what cursor image is being used. I'm trying to set a texture to a sprite based on the mouse state. (win32)   thanks.
  3. DavidGallagher1

    Feature level shaders...

    Thanks a bunch for all the info, yeah that helps fill the gaps up in my understanding of it. appreciate it.
  4. DavidGallagher1

    Feature level shaders...

    I probably didn't explain myself that well, I didn't mean use my sm_5_0 directly (as I have already compiled them all I just wanted to add a new rendering pipeline that would use the dx9 features instead). I meant, being I have a list of shader model 2_x shaders could I just add them to the dx11 engine and run them instead, as my sm 5 shaders use mrt's but of coarse i can't do that in dx9 I just wanted to use the shaders from my older engine in my new dx 11 engine as a seperate pipeline if dx11 isn't supported and was wondering if they still needed to be in the fx shader format or the new hlsl format where vertex and pixel shaders are separate and using cBuffers etc, so compiling a seperate shader frame work is fine with me I just wondered if there was any voodoo I had to perform in porting them, as in do I write the shaders like the .fx files or the same as hlsl 5_0 with seperate vs and ps files if that makes sense. thanks for the link, I'm assuming 2_x is the equivelant to 2_a/2_b based on dx9_b and dx9_c.
  5. Was recently think of adding feature level support to my dx11 engine and was wondering if feature level 9_3 supports shader model 2_a or 2_b. I see that it doesn't support 3_0 but couldn't find info of what shader model 2_x shaders are supported. Also do I write the shaders just like shader model 5_0 as far as data sent to the shaders and just limit them to the limits from my dx9 engine (supporting 2_b and 3_0).thanks for any help in this matter would just be nice to combine both my engines if possible.
  6. DavidGallagher1

    dx9 fullscreen quad artifact (post process - glow)

        couldn't wait, yup success! finally...this was so frustrating but glad it's outta the way.   thanks again.
  7. DavidGallagher1

    dx9 fullscreen quad artifact (post process - glow)

    oh well I redid the post process pipeline and fully adhered to the direct3d9 example and got it working. tomorrow I will see if can do the blur on a smaller texture... Thanks for those that tried to help.  
  8. DavidGallagher1

    dx9 fullscreen quad artifact (post process - glow)

    reverted to doing the half pixel outside of the shader and applying to the buffer directy and only doing blur in the pixel shader...   FLOAT fWidth5 = ( FLOAT )dtdsdRT.Width - 0.5f; FLOAT fHeight5 = ( FLOAT )dtdsdRT.Height - 0.5f; FLOAT fTexWidth1 = (( FLOAT )fWidth5) / (FLOAT)dtdsdRT.Width; FLOAT fTexHeight1 = (( FLOAT )fHeight5) / (FLOAT)dtdsdRT.Height; SCREEN_VERTEX* pVBData; pCamera[CameraIndex].pScreenQuadVB->Lock( 0, 0,( void** )&pVBData, D3DLOCK_DISCARD ); pVBData[0].p = D3DXVECTOR4((fWidth5+PosX), (-0.5f+PosY), 0.5f ,1.0f); pVBData[0].uv = D3DXVECTOR2( fTexWidth1, 0.0f ); pVBData[0].c = D3DXVECTOR4(1.0f,0.0f,0.0f,1.0f); pVBData[1].p = D3DXVECTOR4( ((fWidth5)+PosX), (fHeight5+PosY), 0.5f ,1.0f); pVBData[1].uv = D3DXVECTOR2( fTexWidth1, fTexHeight1 ); pVBData[1].c = D3DXVECTOR4(0.0f,1.0f,0.0f,1.0f); pVBData[2].p = D3DXVECTOR4( (-0.5f+PosX), (-0.5f+PosY), 0.5f ,1.0f); pVBData[2].uv = D3DXVECTOR2( 0.0f, 0.0f ); pVBData[2].c = D3DXVECTOR4(0.0f,0.0f,1.0f,1.0f); pVBData[3].p = D3DXVECTOR4( (-0.5f+PosX), (fHeight5+PosY), 0.5f ,1.0f); pVBData[3].uv = D3DXVECTOR2( 0.0f, fTexHeight1 ); pVBData[3].c = D3DXVECTOR4(1.0f,0.0f,1.0f,1.0f); pCamera[CameraIndex].pScreenQuadVB->Unlock(); gD3D_Device->SetVertexDeclaration(pCamera[CameraIndex].pScreenQuadDecl); gD3D_Device->SetStreamSource(0,pCamera[CameraIndex].pScreenQuadVB,0,sizeof(SCREEN_VERTEX)); gD3D_Device->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2); and this gives this result with ugly line (only did one H and one V blur pass very minimal bluring to make sure i can see artifacts).     and just out of frustration i changed the code above slightly to this... FLOAT fTexWidth1 = (( FLOAT )fWidth5) / (FLOAT)dtdsdRT.Width; FLOAT fTexHeight1 = (( FLOAT )fWidth5) / (FLOAT)dtdsdRT.Height; dividing both by width gave this result with no artifacts (as I manually stretched in the pixel shader, not in this picture though,to see) but not the correct texture scale...       basically if anyone has any ideas what I'm doing wrong please let me know I've tried everything i can think of...   also some additional code being sent to the pixel shader...   float texelKernel[2*13]; float pixToTexX; float pixToTexY; pixToTexX = 1.0f/Width; pixToTexY = 1.0f/Height; float Scale = 1.0f; texelKernel[0]=(-6*pixToTexX)*Scale;texelKernel[1]=(-6*pixToTexY)*Scale; texelKernel[2]=(-5*pixToTexX)*Scale;texelKernel[3]=(-5*pixToTexY)*Scale; texelKernel[4]=(-4*pixToTexX)*Scale;texelKernel[5]=(-4*pixToTexY)*Scale; texelKernel[6]=(-3*pixToTexX)*Scale;texelKernel[7]=(-3*pixToTexY)*Scale; texelKernel[8]=(-2*pixToTexX)*Scale;texelKernel[9]=(-2*pixToTexY)*Scale; texelKernel[10]=(-1*pixToTexX)*Scale;texelKernel[11]=(-1*pixToTexY)*Scale; texelKernel[12]=(0*pixToTexX)*Scale;texelKernel[13]=(0*pixToTexY)*Scale; texelKernel[14]=(1*pixToTexX)*Scale;texelKernel[15]=(1*pixToTexY)*Scale; texelKernel[16]=(2*pixToTexX)*Scale;texelKernel[17]=(2*pixToTexY)*Scale; texelKernel[18]=(3*pixToTexX)*Scale;texelKernel[19]=(3*pixToTexY)*Scale; texelKernel[20]=(4*pixToTexX)*Scale;texelKernel[21]=(4*pixToTexY)*Scale; texelKernel[22]=(5*pixToTexX)*Scale;texelKernel[23]=(5*pixToTexY)*Scale; texelKernel[24]=(6*pixToTexX)*Scale;texelKernel[25]=(6*pixToTexY)*Scale; pFxShader[(DWORD)FxShader_PP].FxShader->SetFloatArray((D3DXHANDLE)"TexelKernelHV",&texelKernel[0],(4+4)*13);
  9. DavidGallagher1

    dx9 fullscreen quad artifact (post process - glow)

    Thanks, will have a look tomorrow to see the samplers are currently just Linear and uv are set to clamp. I may also try using a smaller viewport for the downscaled texture or reducing the quad size, not sure if that is the issue but it might be now that I think about it, the smaller texture is filling the whole screen when blurring so will try that and see.
  10. DavidGallagher1

    dx9 fullscreen quad artifact (post process - glow)

    Thanks, That would have been perfect but it gave these results unfortunatley...don't know what I'm doing wrong :P  
  11. hi, just been going back to my old dx9 renderer and adding some post process effects. I've started on glow/bloom and for some reason I'm getting the seams of the full screen quad showing up. I've tried everything I could think of to erradicate it. I assumed it had something to do with the halfpixel off set but every method i have tried produces the same results. I'm downsampleing to 0.25 of the original image then bluring H, bluring V the blur H and V again. the seams start showing on the first blur V stage. my half pixel for the vertex shader... float2 halfPixel = float2(1.0f/(ViewportSize.x/4.0f),1.0f/(ViewportSize.y/4.0f)); applying it in the pixel shader... UV.x = IN.Tex0.x + (1.0f * IN.Tex0.z);     UV.y = IN.Tex0.y + (1.0f * IN.Tex0.w); have also tried applying it to the vert pos directly in the vertex shader but same results. I'm stumped would appreciate if anyone knows what this is and how to deal with it. below is a pic of the full scrren quad artifact.      
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!