Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    transparence d3d9


    Xenox3
     Share

    Recommended Posts

    Hey GHB,

    I so often tried to make a transparent Box for an d3d9 hook.

    Have someone an sourcecode that works?

     

    This is my Source Code an Box but all Color Codes that should be transparent were not^^

     

    void BOX(LPDIRECT3DDEVICE9 pDevice, int x, int y, int w, int h, D3DCOLOR color)

    {

    D3DRECT rec;

    rec.x1 = x;

    rec.x2 = x + w;

    rec.y1 = y;

    rec.y2 = y + h;

    pDevice->Clear(1, &rec, D3DCLEAR_TARGET, color, 0, 0);

     

    }

     

    I tried so hard to use an d3d9 draw image class . But for this i need the device offset ->hook the create device offset. All starterkits failed^^. And i haven't any ideas for this...

    So someone haven an source code for this O.o too?^^

    Excuse my bad English!

    Edited by Xenox3
    Link to comment
    Share on other sites

    Hey GHB,

    I so often tried to make a transparent Box for an d3d9 hook.

    Have someone an sourcecode that works?

     

    This is my Source Code an Box but all Color Codes that should be transparent were not^^

     

    Clear does not work with transparancy

     

    Underneath a sample for d3d8, just replace the DEVICE8 by DEVICE9 and it will probably work.....

    void DrawFillBox(LPDIRECT3DDEVICE8 pDevice, int x, int y, int w, int h, D3DCOLOR col)
    {
    QuadVertex qV[4] =	{
    	{ (float)x	, (float)(y+h), 0.0f, 0.0f, col},
    	{ (float)x	, (float)y	, 0.0f, 0.0f, col},
    	{ (float)(x+w), (float)(y+h), 0.0f, 0.0f, col},
    	{ (float)(x+w), (float)y	, 0.0f, 0.0f, col}
    };
    //allow for translucency
    
    pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,TRUE);
    pDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);
    
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,qV,sizeof(QuadVertex));
    }

     

    Color should be used including alpha so use 0x40ff0000 (ARGB) for red transparent.

    Link to comment
    Share on other sites

    oh it works :D i love u O.o

    But the game is very buggy :bday2:

    The Box only Works Ingame...^^

     

    And Sometimes the fucking Box is White xD:)

    1s i upload an image^^

    http://img90.imageshack.us/i/asdasdso.jpg/

     

    At WarRock and other games it works fine -.-^^

    Edited by Xenox3
    Link to comment
    Share on other sites

    oh it works :D i love u O.o

    But the game is very buggy :bday2:

    The Box only Works Ingame...^^

     

    And Sometimes the fucking Box is White xD:)

    1s i upload an image^^

     

    depends on the d3d states, usually I draw 1 blank string with d3dfont.cpp before drawing the box, that always works.

    Its because d3dfont sets all kind renderstates before drawing a character.. see function CD3DFont::RestoreDeviceObjects of d3dfont.cpp

    You can find it in the d3d framework zip fle

    Link to comment
    Share on other sites

    1 draw strings too.

    like this

    HRESULT PostReset(LPDIRECT3DDEVICE9 pDevice)///Schrift init

    {

     

     

     

    UW = new CD3DFont("Arial",10, D3DFONT_BOLD);

    UW->InitDeviceObjects(pDevice);

    UW->RestoreDeviceObjects();

    return S_OK;

    }

    O.o

    Edited by Xenox3
    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...