home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 March
/
VPR9703A.ISO
/
VPR_DATA
/
DOGA
/
SOURCES
/
POLYEDIT.LZH
/
READER
/
TEST.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-01-05
|
2KB
|
98 lines
#include <owl\owlpch.h>
#include <owl\applicat.h>
#include <owl\framewin.h>
#include <owl\dc.h>
#include <stdio.h>
#include <dos.h>
extern "C" {
#include "lib.h"
#include "matrix.h"
#include "reader.h"
};
#include "message.h"
static TMessageWindow *MessageOut ;
class TMyApp : public TApplication {
public:
TMyApp() : TApplication() {}
protected:
BOOL isidle ;
void InitMainWindow();
BOOL IdleAction( long );
};
void TMyApp::InitMainWindow()
{
isidle = TRUE ;
MessageOut = new TMessageWindow( "message window", 100 );
SetMainWindow( MessageOut->GetWindowPtr() );
}
void test();
BOOL TMyApp::IdleAction( long /* idleCount */ )
{
#if 1
if ( isidle )
{
test();
isidle = FALSE ;
}
#endif
return FALSE ;
}
int OwlMain(int /*argc*/, char* /*argv*/ [])
{
if ( LibraryInit() < 0 )
return -1 ;
MatrixInit();
ReaderInit();
return TMyApp().Run();
}
void test()
{
int type ;
char name[64] ;
Color col, amb, dif, spc, size ;
int h ;
float x, y, z, vx, vy, vz, u, v ;
wprintf( "start\n" );
if ( AtrReadOpen( "dman.atr" ) == FALSE )
exit( 1 );
while( AtrReadNext() )
{
AtrReadName( name );
wprintf( "atrname : %s\n", name );
type = AtrReadColor( &col, &amb, &dif, &spc, &size, &h );
}
AtrReadClose();
if ( ObjReadOpen( "dman.suf" ) == FALSE )
exit( 1 );
ObjReadName( name );
while( ObjReadPoly( name, &type ) )
{
wprintf( "ReadPoly\n" );
while( ObjReadVertex( &x, &y, &z, &vx, &vy, &vz, &u, &v ) )
{
wprintf( "( %g, %g, %g )\n", x, y, z );
}
wprintf( "\n" );
}
ObjReadClose();
}