• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By Jiraya
      For a 2D game, does using a float2 for position increases performance in any way?
      I know that in the end the vertex shader will have to return a float4 anyway, but does using a float2 decreases the amount of data that will have to be sent from the CPU to the GPU?
    • By ThunderTwonk
      Hello everyone, I am working on a game idea and since I am still in the process of learning C# and the features available in unity I was hoping some of you might be able to offer me a little insight on things in general for getting started.
      I guess the basic components of what I'm wanting to create would be a Multi-levels management/city builder/rpg.
      The goal is to provide a framework for players to interact with, build in and affect the world both from a 3rd person action RPG as well as a zoomed out 4x style view (This would be something unlocked through gameplay)
      As for my questions go I was wondering if anyone had resources that could help me learn.  I've been on youtube as well as enrolled in an online course for basic unity and C# and will continue those but if anyone has any words of advice, a place that has good information and tutorials etc.
      Thanks for your time.
    • By INFRA
      SCAN. DRILL. SURVIVE.   ISOLATED Release in May 1st 2018   https://store.steampowered.com/app/805950/Isolated/   A game by Jérémie Bertrand Music & Sound Design by Pierrick Querolle *** Our solar system has been invaded by strangers. For the purpose of a possible negotiation, a team of astronauts is sent to the moon. Alas, they are shot before even arriving on the scene. Only one astronaut survives the crash and his only goal will be to go home...   GAMEPLAY   Shoot enemy ships to avoid being invaded. Be precise in your movements, because it's better to lose a bit of life at the top than to lose it all at the bottom. Take out your drill to destroy the stones in your path. Validate your identity to cross the different laboratories. Reach the flag before losing your three lives.   And all that... at the same time! Will you be able to go home? If the answer is yes, how long will it take?
    • By Captain Jack
      Two questions: I am trying to rotate chroma in YUV colour space by separating each of the components and applying the following formula.
      int Ut = ((U-128) * cos(hue[H]) + (V-128) * sin(hue[H])) + 128; int Vt = ((V-128) * cos(hue[H]) - (U-128) * sin(hue[H])) + 128; ...where hue[H] is an array of rotation angles between 0.0 and 360.0.
      This seems to work OK but is dog slow. Is there a way to speed this up by converting to integer only calculation and doing away with cosine and sinus? 
      Second, when doing conversion between YUV and RGB, it seems that luma is also affected after rotation. To demonstrate what I mean, I am randomly rotating each line's chroma. The process is:
      Convert from RGB to YUV > rotate chroma > convert to RGB.

      Top left is the original image, the two images on the right are U and V and the bottom left is the luma. As you can see, it seems to have some artefacts from rotation. Is there a way to avoid this?
    • By deadless games
      i'm am looking for volunteers with little or no experience to help with music and graphic design.
      i was thinking of making a platformer game by myself to get into programming but struggled to make music and do Character design
      you PC doesn't need to be amazing,need to be willing to spend time doing your role,
      if you are interested please contact me with one of the means below.
      email deadlessgames@gmail.com
      discord xwolf572#6974
  • Advertisement
  • Advertisement

2D Trying to figure out smooth window resize with Direct2D

Recommended Posts

I really, really would like to have smooth, artifact-free resize of an app that renders its content using Direct2D. (In point of fact, the app is an editor, but I'm using "game-like" techniques to render the UI, and a solution to this problem would be useful for games).

I've been playing with this for a while, and am frustrated that I have a couple of "almost" solutions, but nothing that works robustly. I wrote up my explorations (with links to code) on my blog. The code happens to be in Rust, but I'm calling WinAPI pretty directly, so a working recipe would be easy enough to adapt to or from C++.

I'm feeling stuck enough on this that I'm offering a $2500 bounty for a proper solution. I'd love to be able to make forward progress, and don't want to spend a lot more time on it myself.

I'm not 100% it's even possible on Windows, though I see glimmers of hope.

Share this post

Link to post
Share on other sites
Posted (edited)

Replying to my own question. I think I've figured out a reasonable hybrid solution: use a swapchain with flip swap effect in the steady state, but fall back to a hwnd render target when the window is resizing. I've implemented this and collected reports from users with a wide range of configurations: https://github.com/google/xi-win/issues/19

I suspect this might be the best that can be done, but of course am open to improvements.

Thanks to Jesse (SoldierOfLight) for discussion which helped me understand what's going on.

Edited by Raph
shout-out to SoldierOfLight

Share this post

Link to post
Share on other sites

For what it's worth, prior to Win10 14393 (1607), I think that attempting to switch from a FLIP swapchain to blt or GDI will not work. On those OSes, once a flip swapchain is bound, GDI content in the client region is ignored. Not 100% sure whether it was 1607, might've been the release before or after.

Share this post

Link to post
Share on other sites

SoldierOfLight: does it matter that I'm creating the swapchain for composition rather than binding it directly to the window? In any case, if it does turn out to be a problem, it'll be easy enough to version-check and fall back to a different strategy.

Share this post

Link to post
Share on other sites

That's an excellent question. In that case, I think you're okay. I believe that using DComp to layer on top of a window is different than binding the swapchain directly to the window. I'm not positive though, my experience with DComp is pretty minimal.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement