Class Hierarchy   Compound List   Compound Members   Related Pages  

display.h

This is the verbatim text of the display.h include file.



#ifndef _DISPLAY_H_
#define _DISPLAY_H_

#include "stdafx.h"

class NativePlayerWnd;


class NativeDisplayTester
{
  public:

	NativeDisplayTester();

	~NativeDisplayTester();


	void TestDepth( int depth );

	int	BestDetectedFormat()	{ return bestFormat; }


	BOOL BestDetectedInvert()	{ return true; }		

	/*	Relation of the depth to the number of colors:
	 *			depth	nColors
	 *			1		2
	 *			2		4
	 *			4		16
	 *			8		256
	 *			16		64k		(k=1024)
	 *			24		16 million
	 *			32		16 million	-- Note the cheat. We can't return a number that big.
	 */

	static int CurrentScreenBitDepth();
	static U32 CurrentScreenColors();
	
	// ----- Platform independant - don't change these functions ------
	// These are conversion functions from format (say pix8) to depth (256)
	static int PixelFormatToDepth( int format )				{ return mapPixelFormatToDepth[ format ]; }
	static int DepthToSimplestPixelFormat( int depth );

  private:
	void	test( int pixFormat, BOOL inverted );

	static const int mapPixelFormatToDepth[9];

	int  bestFormat;
	BOOL bestInvert;
};


class NativeBitmap
{
  public:
 
	NativeBitmap(	NativePlayerWnd* native,
					const SColorTable* ctab,
					int width, int height, int depth, int pixelFormat );


	~NativeBitmap();

	int Height()		{ return height; }
	int Width()			{ return width; }
	U8* Bits()			{ return bits; }
	int ScanLine()		{ return bytesPerLine; }
	int PixelFormat()	{ return format; }
	int Depth()			{ return depth; }


	void Flush()		{ GdiFlush(); }		


	void BltNativeToScreen( NativePlayerWnd* native,
							  int xDest,	int yDest,		// upper left target on screen
							  int cx,		int cy,			// size to blt
							  int xSource,	int ySource		// where to start drawing from
							);

	void ClearScreen( NativePlayerWnd* );

  private:
	struct BITMAPINFO256 
	{
	   BITMAPINFOHEADER bmiHeader; 
	   RGBQUAD          bmiColors[256]; 
	};

	int		format;
	int		depth;
	int		width;
	int		height;
	U8*		bits;
	int		bytesPerLine;

	HBITMAP hBitmap;
	BITMAPINFO256 info;
	HPALETTE palette;
};

#endif

Version 1.0 of the Flash 4 Porting SDK                        Middlesoft, Inc.