home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Panoráma
/
computer_panorama_1997-12-hibas.iso
/
SHARE
/
GRAPH
/
PTC051.ZIP
/
SRC
/
ISOFT.H
< prev
next >
Wrap
C/C++ Source or Header
|
1997-09-22
|
5KB
|
147 lines
////////////////////////
// Software interface //
////////////////////////
#ifndef __ISOFTWARE_H
#define __ISOFTWARE_H
#include "iface.h"
class ISoftware : public Interface
{
public:
// setup
ISoftware(HWINDOW window=NULL);
virtual ~ISoftware();
// interface information
virtual INFO GetInfo();
virtual int GetModeList(List<MODE> &modelist);
// display mode routines
virtual int SetMode(MODE const &info);
virtual int SetMode(int x,int y,int id,int layout,int output,int frequency);
virtual int SetMode(int x,int y,FORMAT const &format,int layout,int output,int frequency);
virtual int QueryMode(MODE const &info);
virtual int QueryMode(int x,int y,int id,int layout,int output,int frequency);
virtual int QueryMode(int x,int y,FORMAT const &format,int layout,int output,int frequency);
virtual MODE GetMode();
// palette routines
virtual int SetPalette(Palette &palette);
virtual int GetPalette(Palette &palette);
// hardware functions
virtual int WaitForRetrace();
virtual int SaveState();
virtual int RestoreState();
// primary surface operations
virtual int SetPrimary(Surface &surface);
virtual Surface* GetPrimary();
virtual int SetOrigin(int x,int y);
virtual int GetOrigin(int &x,int &y);
// video memory management
virtual int GetTotalVideoMemory();
virtual int GetFreeVideoMemory();
virtual int CompactVideoMemory();
// console routines
virtual int getch();
virtual int kbhit();
virtual int keydown(int key);
// native access
virtual void* GetNative();
virtual int NativeType();
// data access
virtual void GetName(char name[]) const;
virtual int GetXResolution() const;
virtual int GetYResolution() const;
virtual int GetBitsPerPixel() const;
virtual int GetBytesPerPixel() const;
virtual int GetLayout() const;
virtual int GetOutput() const;
virtual int GetFrequency() const;
virtual FORMAT GetFormat() const;
virtual HWINDOW GetWindow() const;
// object state
virtual int ok() const;
protected:
// surface management
virtual HSURFACE RequestSurface(Surface &owner,int x,int y,FORMAT const &format,int type,int layout,int advance);
virtual void FreeSurface(HSURFACE handle);
virtual void* LockSurface(HSURFACE handle,int wait);
virtual void UnlockSurface(HSURFACE handle);
virtual int GetSurfaceLockCount(HSURFACE handle);
virtual int RestoreSurface(HSURFACE handle);
virtual SURFACEINFO GetSurfaceInfo(HSURFACE handle);
virtual void* GetNativeSurface(HSURFACE handle);
virtual int GetNativeSurfaceType(HSURFACE handle);
virtual void SetOwnerSurface(HSURFACE handle,Surface *owner);
// surface clear
virtual int Clear(Surface &surface,COLOR const &color);
virtual int Clear(Surface &surface,RECTANGLE const &rect,COLOR const &color);
// surface update
virtual int Update(Surface &src,void *extra);
virtual int Update(Surface &src,RECTANGLE const &rect,void *extra);
virtual int Update(Surface &src,RECTANGLE const &dest_rect,RECTANGLE const &src_rect,void *extra);
// surface bitblt
virtual int BitBlt(Surface &src,Surface &dest,EFFECTS const *effects,void *extra);
virtual int BitBlt(Surface &src,Surface &dest,RECTANGLE const &rect,EFFECTS const *effects,void *extra);
virtual int BitBlt(Surface &src,RECTANGLE const &src_rect,
Surface &dest,RECTANGLE const &dest_rect,EFFECTS const *effects,void *extra);
// surface stretchblt
virtual int StretchBlt(Surface &src,Surface &dest,EFFECTS const *effects,void *extra);
virtual int StretchBlt(Surface &src,Surface &dest,RECTANGLE const &rect,EFFECTS const *effects,void *extra);
virtual int StretchBlt(Surface &src,RECTANGLE const &src_rect,
Surface &dest,RECTANGLE const &dest_rect,EFFECTS const *effects,void *extra);
// clipping and cropping
int ClipAndCrop(Surface const &src,Surface const &dest,RECTANGLE &rect);
int ClipAndCrop(Surface const &src,RECTANGLE &src_rect,Surface const &dest,RECTANGLE &dest_rect);
private:
// format converter
CONVERTER Converter;
// software surface
struct SURFACE
{
Surface *owner;
void *buffer;
int count;
SURFACEINFO info;
};
// software surface list
List<SURFACE> SurfaceList;
};
#endif