Jump to content
  • Advertisement
Sign in to follow this  

OpenGL MapModes and memdc

This topic is 4878 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

I can't seem to find out how to accomplish using a memory DC correctly when my Screen DC Mapping Mode is set to MM_ANISOTROPIC. Here's the information: I want to plot a world map using latitudes and logitudes without a lot of conversions, so I've set my screen DC as MM_ANISOTROPIC with Window Extents of 360000 x 180000. Then I set my Viewport ORG so that 0,0 is in center of the screen. Upper Left corner is -180000, 90000. Lower right corner is 180000, -90000. This satisfies the correct real-world orientation. Here is the code for that: SetMapMode (hdc, MM_ANISOTROPIC); SetWindowExtEx (hdc, 360000, 180000, NULL); SetViewportExtEx(hdc, cxClient / 2, -cyClient / 2 , NULL); SetViewportOrgEx(hdc, cxClient / 2, cyClient / 2 , NULL); I want to setup a memory DC so that I can write to it and then bitblt is to the Screen DC. I'm wanting to do this so that I can over-write the map with other objects that will be moving....such as airplanes, ships, etc... Here's the code I've used to set up the memory DC: GetClientRect(hwnd, &rc); hdcMem = CreateCompatibleDC(hdc); hbmMem = CreateCompatibleBitmap(hdc, rc.right-rc.left, rc.bottom-rc.top); hbmOld = SelectObject(hdcMem, hbmMem); I'm confused on what mapping mode to set up for hdcMem. So I 0set: SetMapMode (hdcMem, MM_ANISOTROPIC); SetWindowExtEx (hdcMem, 360000, 180000, NULL); SetViewportExtEx(hdcMem, cxClient / 2, -cyClient / 2 , NULL); SetViewportOrgEx(hdcMem, cxClient / 2, cyClient / 2 , NULL); ??? And then on the bitblt.....what are the starting points for hdc and hdcMem??? BitBlt(hdc, -180000, -90000, 360000, 180000, hdcMem, -180000, -90000, SRCCOPY); I can't seem to find ANY examples of this anywhere. I've tried all sorts of combinations of MapModes for the hdcMem, and different BitBlts I am stictly using SDK, with no MFC, DirectX, or OpenGL. I know that sounds crazy, but I really want to see this through!! Anyone have any ideas???

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!