This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Tips & help to convert 3D to work in PocketFrog


Tips & help to convert 3D to work in PocketFrog

Postby Conan » Jul 5, 2002 @ 8:59pm

What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Postby Kzinti » Jul 6, 2002 @ 4:29am

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


3d and Jornada 720's

Postby Conan » Jul 6, 2002 @ 7:38am

What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


What's an HBITMAP

Postby Conan » Jul 9, 2002 @ 3:01pm

What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Postby Kzinti » Jul 9, 2002 @ 6:46pm

What does PocketGL provides you with? I though it was giving you a HBITMAP, but it seems from your last message that this is not the case?

What do you have to work with?
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


PocketGL Bitmaps

Postby Conan » Jul 9, 2002 @ 8:04pm

What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


code from PocketGL's display

Postby Conan » Jul 9, 2002 @ 10:34pm

Here's the code. I was latterly trying to give Blit the HBITMAP defined near the end

//**** from the display.h
extern BITMAP OffscreenBitmap;
//******** from the display.cpp
BITMAP OffscreenBitmap;

#ifdef GAPI
#include "..\\gapi\\arm\\gx.h"
GXDisplayProperties DisplayProperties;
#else
HBITMAP hOffscreenBitmap;
HDC hDCMem;
#endif

// ----------------------
// Display initialisation
unsigned char DISPLAYinit(HWND hWnd)
{
#ifdef GAPI
GXOpenDisplay(hWnd, GX_FULLSCREEN);
DisplayProperties = GXGetDisplayProperties();

// Create the offscreen bitmap used as a secondary surface to build next image.
OffscreenBitmap.bmWidth = DISP_X;
OffscreenBitmap.bmHeight = DISP_Y;
OffscreenBitmap.bmBitsPixel = 16;
OffscreenBitmap.bmPlanes = 1;
OffscreenBitmap.bmBits = NULL; // (unsigned short *)malloc(DISP_X * DISP_Y * 2);



#else // code pc

long Data[256];
unsigned long *ColorMask;
BITMAPINFO *BitmapInfo;
HDC hDC = GetDC(hWnd);

// For Win32, create a DIB section compatible with original main game window DC.
BitmapInfo = (BITMAPINFO *)Data;
BitmapInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
BitmapInfo->bmiHeader.biBitCount = 16;
BitmapInfo->bmiHeader.biWidth = DISP_X;
BitmapInfo->bmiHeader.biHeight = -DISP_Y;
BitmapInfo->bmiHeader.biPlanes = 1;
BitmapInfo->bmiHeader.biCompression = BI_BITFIELDS;
BitmapInfo->bmiHeader.biSizeImage = DISP_X * DISP_Y * 2;
BitmapInfo->bmiHeader.biClrUsed = 0;
BitmapInfo->bmiHeader.biClrImportant = 0;
BitmapInfo->bmiHeader.biXPelsPerMeter = 0;
BitmapInfo->bmiHeader.biYPelsPerMeter = 0;
ColorMask = (unsigned long *)&BitmapInfo->bmiColors[0];
ColorMask[0] = 0xF800;
ColorMask[1] = 0x7E0;
ColorMask[2] = 0x1F;
hOffscreenBitmap = CreateDIBSection(hDC, BitmapInfo, DIB_RGB_COLORS, &OffscreenBitmap.bmBits, NULL, 0);
OffscreenBitmap.bmWidth = DISP_X;
OffscreenBitmap.bmHeight = DISP_Y;
OffscreenBitmap.bmBitsPixel = 16;
OffscreenBitmap.bmPlanes = 1;

// And create a memory DC used to blit offscreen bitmap to main window.
hDCMem = CreateCompatibleDC(hDC);
ReleaseDC(hWnd, hDC);
#endif
return(1);
}


//****** DISPLAY UPDATE CODE FOR PC version
#else // code for PC
HBITMAP OriginalBitmap;

OriginalBitmap = (HBITMAP)SelectObject(hDCMem, hOffscreenBitmap); // Blit from memory DC to game window DC.
unsigned short *VirtualScreen = (unsigned short *)OffscreenBitmap.bmBits;

for (int i=0; i<DISP_X*DISP_Y; i++)
{
VirtualScreen[i] = VScreen[i];
VScreen[i] = 0;
ZBuffer[i] = FAR_CLIP;
}

BitBlt(hDC, 0, 0, DISP_X, DISP_Y, hDCMem, 0, 0, SRCCOPY);
SelectObject(hDCMem, OriginalBitmap);
What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Return to PocketFrog & PocketHAL


Sort


Forum Description

SDKs for fast and robust device-independent access to Pocket PC display hardware.

Moderators:

sponge, Kzinti

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum