home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Panoráma
/
computer_panorama_1997-12-hibas.iso
/
SHARE
/
GRAPH
/
PTC051.ZIP
/
SRC
/
PTC.H
< prev
next >
Wrap
C/C++ Source or Header
|
1997-09-20
|
9KB
|
363 lines
//////////////////////////
// prometheus truecolor //
//////////////////////////
#ifndef __PTC_H
#define __PTC_H
#include "lang.h"
#include "misc.h"
#include "config.h"
#include "globals.h"
#include "classes.h"
#include "iface.h"
class PTC
{
public:
// setup
PTC();
~PTC();
// user constructors
PTC(MODE const &mode);
PTC(int x,int y,int id=FUZZY32,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
PTC(int x,int y,FORMAT format,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
PTC(HWINDOW window,MODE const &mode);
PTC(HWINDOW window,int x,int y,int id=FUZZY32,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
PTC(HWINDOW window,int x,int y,FORMAT format,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
// interface name string constructors
PTC(char name[],int x,int y,int id=FUZZY32,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
PTC(char name[],int x,int y,FORMAT format,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
PTC(char name[],HWINDOW window,int x,int y,int id=FUZZY32,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
PTC(char name[],HWINDOW window,int x,int y,FORMAT format,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
// command line constructors
PTC(int argc,char *argv[],int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
PTC(int x,int y,int argc,char *argv[],int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
PTC(HWINDOW window,int argc,char *argv[],int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
PTC(HWINDOW window,int x,int y,int argc,char *argv[],int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
// user initialize
int Init(MODE const &mode);
int Init(int x,int y,int id=FUZZY32,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
int Init(int x,int y,FORMAT format,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
int Init(HWINDOW window,MODE const &mode);
int Init(HWINDOW window,int x,int y,int id=FUZZY32,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
int Init(HWINDOW window,int x,int y,FORMAT format,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
// interface name string constructors
int Init(char name[],int x,int y,int id=FUZZY32,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
int Init(char name[],int x,int y,FORMAT format,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
int Init(char name[],HWINDOW window,int x,int y,int id=FUZZY32,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
int Init(char name[],HWINDOW window,int x,int y,FORMAT format,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
// command line initialize
int Init(int argc,char *argv[],int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
int Init(int x,int y,int argc,char *argv[],int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
int Init(HWINDOW window,int argc,char *argv[],int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
int Init(HWINDOW window,int x,int y,int argc,char *argv[],int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
// close
void Close();
// mode list information
int GetModeList(List<MODE> &modelist);
// current interface information
INFO GetInfo();
// mode set
inline int SetMode(MODE const &mode);
inline int SetMode(int x,int y,int id=FUZZY32,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
inline int SetMode(int x,int y,FORMAT const &format,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
inline int QueryMode(MODE const &mode);
inline int QueryMode(int x,int y,int id,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
inline int QueryMode(int x,int y,FORMAT const &format,int layout=DEFAULT,int output=DEFAULT,int frequency=DEFAULT);
inline MODE GetMode();
// palette control
inline int SetPalette(Palette &palette);
inline int GetPalette(Palette &palette);
// hardware functions
inline void WaitForRetrace();
inline int SaveState();
inline int RestoreState();
// primary surface operations
inline int SetPrimary(Surface &surface);
inline Surface* GetPrimary();
inline int SetOrigin(int x,int y);
inline int GetOrigin(int &x,int &y);
// console routines
inline int getch();
inline int kbhit();
inline int keydown(int key);
// data access
inline void GetName(char name[]) const;
inline uint GetXResolution() const;
inline uint GetYResolution() const;
inline uint GetBitsPerPixel() const;
inline uint GetBytesPerPixel() const;
inline int GetLayout() const;
inline int GetOutput() const;
inline int GetFrequency() const;
inline FORMAT GetFormat() const;
inline HWINDOW GetWindow() const;
// interface access
inline Interface* GetInterface() const;
// object status
inline int ok() const;
protected:
// setup data defaults
void Defaults();
// local interface
Interface *LocalInterface;
// dummy interface
static IDummy DummyInterface;
};
// interdependant classes
#include "surface.h"
// inline wrapper functions
inline INFO PTC::GetInfo()
{
return LocalInterface->GetInfo();
}
inline int PTC::SetMode(MODE const &mode)
{
return LocalInterface->SetMode(mode);
}
inline int PTC::SetMode(int x,int y,int id,int layout,int output,int frequency)
{
return LocalInterface->SetMode(x,y,id,layout,output,frequency);
}
inline int PTC::SetMode(int x,int y,FORMAT const &format,int layout,int output,int frequency)
{
return LocalInterface->SetMode(x,y,format,layout,output,frequency);
}
inline int PTC::QueryMode(MODE const &mode)
{
return LocalInterface->QueryMode(mode);
}
inline int PTC::QueryMode(int x,int y,int id,int layout,int output,int frequency)
{
return LocalInterface->QueryMode(x,y,id,layout,output,frequency);
}
inline int PTC::QueryMode(int x,int y,FORMAT const &format,int layout,int output,int frequency)
{
return LocalInterface->QueryMode(x,y,format,layout,output,frequency);
}
inline MODE PTC::GetMode()
{
return LocalInterface->GetMode();
}
inline int PTC::SetPalette(Palette &palette)
{
return LocalInterface->SetPalette(palette);
}
inline int PTC::GetPalette(Palette &palette)
{
return LocalInterface->GetPalette(palette);
}
inline void PTC::WaitForRetrace()
{
LocalInterface->WaitForRetrace();
}
inline int PTC::SaveState()
{
return LocalInterface->SaveState();
}
inline int PTC::RestoreState()
{
return LocalInterface->RestoreState();
}
inline int PTC::SetPrimary(Surface &surface)
{
return LocalInterface->SetPrimary(surface);
}
inline Surface* PTC::GetPrimary()
{
return LocalInterface->GetPrimary();
}
inline int PTC::SetOrigin(int x,int y)
{
return LocalInterface->SetOrigin(x,y);
}
inline int PTC::GetOrigin(int &x,int &y)
{
return LocalInterface->GetOrigin(x,y);
}
inline int PTC::getch()
{
return LocalInterface->getch();
}
inline int PTC::kbhit()
{
return LocalInterface->kbhit();
}
inline int PTC::keydown(int key)
{
return LocalInterface->keydown(key);
}
inline void PTC::GetName(char name[]) const
{
LocalInterface->GetName(name);
}
inline uint PTC::GetXResolution() const
{