Jump to content
  • Advertisement
Sign in to follow this  
wolf_fallout

use directx in windowed mode

This topic is 4416 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello every body! have problem, help me please! I want to make a map editor with direct x, the following are my setting -Use windowed mode, not fullscreen -Use directx7 surface for primary and backbuffer, -the tile images are stored in ddsurface -draw the tile on backbuffer, then blit to primary surface( i used blit, not flip, sorry for this mistake) -use modeless dialog as tile picker -intend to draw tileset on dialog, problem: -can't draw the tile image on dialog, I can draw text with DC on the dialog, but the tile image is failed. I can draw tile image on mode dialog with FlipToGDISurface, but failed in modeless dialog what should i do to solve this problem? I want to create map editor which the tile picker floated within window's client area. I tried: GetSurfaceFromDC()& GetGDISurface()/FlipToGDISurface() which one should i use. Does there any method can solve this problem. Does there any sample about that! Forgive my poor english!!!!

Share this post


Link to post
Share on other sites
Advertisement
As Steve posted - one thread is enough: 5 almost identical threads in 2 days is not appreciated [smile]

I'll leave this one open for now as its possible that you've got the right forum - but I don't fully understand your question..

Would the following be a correct interpretation of your problem?

  • You have your tiles stored in memory using DirectDraw - and you can render them to other DirectDraw front/back buffers?

  • You have an additional dialog that you want to display the tile on?

    If so, I think your problem might be a design-level problem. DirectX tends to connect to a specific window (be it DDraw, D3D, DSound...), and GDI and DirectDraw aren't interchangeable in the direction you seem to indicate. The methods you've found (iirc) are so you can use GDI on DD, not DD on GDI.

    The simplest way is probably to just create two copies of your tiles - one for your GDI-based rendering and one for your DD-based rendering.

    hth
    Jack

    Share this post


    Link to post
    Share on other sites
    Jack, thanks for your opinion. thanks a lot.
    You are right, I just want to display the tile on the dialog! I am trying to experience more directx api, so i try this.

    why does it worked on modal dialog and failed on modeless dialog!? and there have any method can display a ddsurface object on a modeless dialog!??!?!

    Share this post


    Link to post
    Share on other sites
    Why DD 7? Why not use D3D 9.1, orthographic projection, and pretransformed vertices?

    I've never tried to render to a modeless dialog, but are you sure it's not responding to a WM_PAINT message directly after you alter it?

    Share this post


    Link to post
    Share on other sites
    From your other thread:
    Quote:
    Original post by Evil Steve
    What language? I'll assume C++ for now.

    From my understanding (I've not done much with DirectDraw, and if you've only just started, I strongly recommend switching over to D3D9), you need to create a DDraw surface for the dialog too. The dialog has no relation to the main window, so it'll need its own surface and swap chain for it.

    Again, I'm not entirely sure. You should really be using Direct3D (Or OpenGL if you prefer. Or SDL even...)
    Although it's been a while since I've used DDraw. You really want to use D3D unless you have a really good reason not to.

    Share this post


    Link to post
    Share on other sites
    Sign in to follow this  

    • Advertisement
    ×

    Important Information

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

    Participate in the game development conversation and more when you create an account on GameDev.net!

    Sign me up!