SilverEngine Development Reference

Table of Contents

Introduction

SilverEngine Development
About This Document
SilverEngine and the SilverScreen API

SilverEngine Application Development

Overview
SilverEngine Basics
   Loading SilverEngine
   SilverEngine Startup
   SilverEngine Shutdown
SilverScreen Basics
   Drawings, Screens and Windows
   Screens
   Windows
   Drawings
Windows Basics
   Windows and Device Contexts
Windows MFC Basics
   Applications, Documents, Views and Frame Windows
Putting It All Together
   Overview
   Making the Connection
   Managing the Connection
   A Note on Screens
   Closing the Connection
Primer for MFC Applications
   CWinApp Modifications
   CView Modifications
Non-MFC Applications

SilverEngine Functions

sdc_goto
sdc_close
sdc_open
engine_initialize
engine_set_frame_window

Technical Notes

Implementation Notes
Non-Graphical Use of SilverEngine
Other Compilers
SilverEngine Components
   Core Components
   Support Files
   External DLLs

Sample Projects

MFC MDI
   SSMDI Project
   SDCPrint Project
   MFCPrint Project
Win32
   Win32 Project

 

Introduction

SilverEngine Development

The SilverEngine is CAD engine development platform that allows developers to integrate SilverScreen solid modeling technology into their applications. SilverEngine is a DLL implementation of the SilverScreen API, which is a set of functions used to develop application products that use SilverScreen solid modeling technologies, and is common to all SilverScreen development platforms. SilverEngine differs from the other platforms (SilverPlus and SilverC) in that standalone SilverScreen is not needed to run the application product. All that is needed is to link to SilverEngine.

About This Document

This document describes the SilverEngine development system, which is a function library used to build applications that utilize the SilverScreen solid modeling technologies. The document is divided into several parts:

  • SilverEngine Application Development
  • SilverScreen API Functions specific to SilverEngine Development
  • SilverEngine Technical Notes
  • SilverEngine Examples

The section on SilverEngine Examples is provided to demonstrate use of the SilverEngine development system in several contexts:

  • MFC SDI
  • MDI MDI
  • Win32

SilverEngine and the SilverScreen API

SilverEngine is a DLL whose programming interface, or API, is an instance of the SilverScreen API. The SilverScreen API is a collection of types, macros, structures and functions that are used to program SilverScreen Solid Modeler applications. The SilverScreen API is expressed differently in various contexts (e.g. SilverC applications, DLLs for SilverScreen, SilverEngine applications), but is designed to be as consistent across all platforms as possible. This document covers details of the SilverScreen API that are specific to use of the SilverEngine.

Note that the SilverScreen API is expressed in the C language. Programs may also be written in the C++ language.

Using the SilverScreen API with SilverEngine is accomplished via the following steps:

  • Include the SILVER.H file in your program.
  • Define the preprocessor constant SILVERENGINE_CLIENT_BUILD
  • Ensure that the SilverScreen include files are visible to the compiler. These files are typically installed into the Silver directory. With Visual C++, you should select Settings… from the Project menu, and then select the C/C++ tab. Choose Preprocessor from the Category list, and make sure that the directory is included in the Additional include directories: entry.
  • Ensure that the Engine link libraries (ENGINE.LIB or ENGINED.LIB) are visible to the linker. These files are typically installed into the Silver directory With Visual C++, you should select Settings… from the Project menu, and then select the Link tab. Choose Input from the Category list, and make sure that the directory is included in the Additional library path: entry.

Use of SILVER.H pulls in all of the appropriate include files needed for SilverEngine development, and in addition, defines for the compiler the name of the link library needed to resolve references in the run-time SilverEngine library.

Note that the file SILVERE.H contains a small number of SilverEngine-specific structures and function declarations. These functions are necessary for startup and shutdown of the SilverEngine, plus setup for display of SilverScreen models, but are not considered to be a proper part of the SilverScreen API. SILVERE.H depends on SILVER.H, and includes it.

More detailed information about using the SilverScreen API is available in The SilverScreen API Reference.

 

SilverEngine Application Development

Overview

A SilverEngine application is one that manipulates, and typically views or renders, SilverScreen drawings using of the SilverEngine DLL. Manipulation of SilverScreen drawings is largely the province of the SilverScreen API, and is not covered here. What is relevant here is the startup and shutdown of the SilverEngine DLL, and aspects relating to viewing and rendering SilverScreen drawings.

SilverEngine Basics

Loading SilverEngine

SilverEngine is implemented as a Win32 DLL. A SilverEngine application should link implicitly to SilverEngine. This means that the bookkeeping tasks associated with locating and loading the DLL, resolving its symbolic references, and unloading SilverEngine are handled by the operating system.

It is possible, albeit impractical to link to SilverEngine explicitly, by using the Win32 API function LoadLibrary. Such an approach would require that any needed SilverScreen API functions be obtained via the Win32 API function GetProcAddress.

SilverEngine Startup

The SilverEngine DLL must be initialized before it may be used. To do this, the engine_initialize function is used. The engine_initialize function supplies SilverEngine with the name of a SilverScreen environment file (.ENV). This environment file contains a number of important startup settings for SilverEngine.

Other functions that may be called in the initialization phase are:

Function Description
engine_set_frame_window Define frame window to SilverEngine, for purposes of attachment of UI elements
set_qmessage_handler Define a handler for SilverEngine status messages
set_show_error_handler Define a handler for SilverEngine error messages
set_location_change_handler Define a handler for SilverEngine WORLDXYZ location change notifications
set_status_change_handler Define a handler for SilverEngine status changes (e.g. grid, space, snap, etc. changes)
set_tempfile_create_handler Define a function that is notified when a temporary file is created by SilverEngine
set_tempfile_close_handler Define a function that is notified when a temporary file is created by SilverEngine

SilverEngine Shutdown

SilverEngine shutdown is accomplished automatically when the SilverEngine DLL is unloaded. Typically this means when the SilverEngine client exits.

SilverScreen Basics

Drawings, Screens and Windows

The fundamental document in SilverScreen is a drawing (.DRW). A drawing contains geometry, plus various other structures. Drawings are viewed by associating them with a window on a screen. A screen is a viewing area that is composed of tiled windows, and possibly containing overlay windows that overlap the underlying tiled windows.

SilverScreen maintains a list of drawings, and a list of screens. Each screen maintains its own list of the windows that comprise the screen, and each window refers to the drawing that is displayed in the window.

SilverScreen Architecture

Fig. 1 SilverScreen Screen/Window/Drawing Architecture

Screens

Screens are accessed by name. The name of the currently active screen is obtained by using the function sys_screen. A list of the current screens may be obtained by using the function collect_generic( GN_SCREENS, … ), and their names may then be obtained by using get_generic. Screen dimensions are 0-based from the top-left corner: to obtain the width and height of the currently active screen, use the variables vpixel_right and vpixel_bot. To change to a different screen using its name, use the command SCREEN GOTO <screen-name>.

Windows

SilverScreen windows are accessed by window number. Numbers are assigned automatically by the system, and may be changed when certain operations occur, particularly those that create or destroy new windows on the screen. Window numbers are 1-based, and the highest window number on the screen is the number of windows on the screen. The currently active window (in the currently active screen) is obtained by using sys_window. The number of windows on the current screen is given by count_windows. To change to a different window using its number, use the command WINDOW GOTO <window-number>.

Drawings

Drawings are not directly accessible. The name of the current drawing (that is, the drawing loaded in the current window on the current screen) is obtained by using the function sys_drawing. Drawing attributes may be obtained by various means. To access the current drawing’s geometry, you may obtain the root block by using get_block( "\\" ).

Windows Basics

Programming Windows applications is a topic that is far too large to cover here in any detail. However, we include a little overview that introduces some basic Windows concepts that are important for SilverEngine development.

Windows and Device Contexts

Under Windows, a window is the basic unit of display area, that is, a rectangular area of a display device (typically a computer screen). A window is the locus of application output and user input, and is identified to the programmer via its handle (HWND). A device context, or DC, is an operating system object that allows the application to draw on a window, and in particular, contains an associated bitmap representing the display surface of the window. A device context is identified to the programmer via its associated handle (HDC). Windows graphics functions do not take an HWND as an argument, but rather an HDC. Because an HDC can represent not only a windows on a display screen, but bitmaps and other output devices such as printers, Windows graphics functions take an HDC as an argument.

In a Windows application, display is typically handled in response to a WM_PAINT message sent to a window. In such a handler, the application receives an HDC representing the display area to be painted.

Windows MFC Basics

Applications, Documents, Views and Frame Windows

The Microsoft Foundation Classes is a C++ class library that encapsulates many of the standard Windows objects. In particular, two of these are of interest: the window (HWND) and device context (HDC). The MFC classes CWnd and CDC encapsulate HWND and HDC respectively. The MFC application class CWinApp is also important.

Applications

An application is just another name for a module (executable program or DLL). In MFC, an application is usually encapsulated by a class derived from the CWinApp class. There can be only one CWinApp-derived class in a module.

Documents

A document in MFC is a file containing user information. With respect to SilverScreen, a drawing (.DRW) is the primary document type. An MFC document is usually represented by a class derived from CDocument.

Views

A view in MFC is a window in which a document is displayed. An MFC view is usually represented by a class derived from CView. CView is a class where handlers for many common Windows messages, including WM_PAINT and WM_SIZE typically reside.

Frame Windows

A frame window in MFC is a window that contains an application’s views, plus other UI elements, such as toolbars and menus. In MFC, a frame window is usually derived from CFrameWnd. MFC supports several different types of applications:

  • SDI (Single Document Interface), where there is only one view embedded in the frame window, and hence only one document active at a time
  • MDI (Multiple Document Interface), where several views may be contained by a frame window, and multiple documents open all at once.

Frame windows are often the focal point of UI messages, and SilverEngine uses the frame window, if supplied, as a parent to its own set of UI elements, such as prompting dialogs and popup menus.

Putting It All Together

Overview

The essence of SilverEngine usage is to render SilverScreen screens into Windows windows. In order to do this, the sdc_open function is used to make a connection between SilverScreen and Windows. It is important to remember that the application is responsible for maintaining device display; SilverEngine should be used to generate bitmaps for display refresh.

Making the Connection

sdc_open has as its parameter a pointer to a SDCInitStruct, which contains as its members a window handle (HWND) and two associated device context handles (HDCs). The first HDC is referred to as the draw context, and represents the actual display surface, usually a window on the screen. The second HDC is referred to as the refresh context, and represents a backing bitmap for the first device context. The intent is that you get SilverScreen to render to your refresh DC, and then you update the display (draw DC) from the refresh DC. By doing so, any type of SilverScreen display, whether wireframe, hidden-line, or other hidden-surface rendering, may be refreshed correctly onto the display DC.

Managing the Connection

sdc_open returns an handle of type SDC which may be used to refer to the connection you’ve made in subsequent calls to sdc_goto or sdc_close. sdc_goto is particularly useful for ensuring that the proper SDC is active when repainting a particular screen. Typically, before you repaint or render the contents of a screen, you would perform the following sequence:

  • Set current screen/window, manipulate drawing(s), change views, etc.:

ss_command( "DRAW RECTANGLE 7,130 18,4,0" );
ss_command( "A-ROTATE DRAWING ANGLE 30" );

  • Set current Silver device context:

sdc_goto( SDCHandle );

  • Render drawing(s) on screen using REFRESH or REPAINT commands:

ss_command( "REFRESH ALL" );

  • Invalidate window associated with Silver device context:

::Invalidate( m_hWnd, FALSE );

  • Respond to the subsequent WM_PAINT message (or CView::OnDraw); update screen from refresh DC via BitBlt

A Note on Screens

Screen size is a very important concept to keep straight in SilverEngine, as it is used in calculating viewing parameters and also in display refresh. Screen size is currently maintained as a single set of variables in SilverEngine – all screens are assumed to be the same size. Since the developer is in control of the windows that are mapped to SilverEngine screens, it is up to the developer to ensure that SilverEngine remains informed as to the proper screen size. This is done by using the SilverC function screen_resize. screen_resize sets the global screen size maintained by SilverEngine. screen_resize should be called before causing a screen or window to be repainted, especially in cases where the screen’s window may have been resized since the previous repaint, or when switching between different sized windows in your application.

Closing the Connection

When you are finished using a particular SilverEngine connection, as would be the case when you are closing its associated window or view, then you should close it by using the sdc_close function.

Primer for MFC Applications

For MFC applications, it is a relatively simple task to get up and running with the SilverScreen engine. The following describes a pretty simple-minded application.

Essentially there are few things to do to integrate SilverEngine:

  • The first step is to create a new application in Visual C++. It may be SDI or MDI. Next, we will need to make some additions to the wizard-generated code.
  • Very important. Next, add the following preprocessor constant to your project: SILVERENGINE_CLIENT_BUILD. From the Project menu, select Settings. Choose the C/C++ tab, and select Preprocessor from the Category listbox. Add SILVERENGINE_CLIENT_BUILD to the Preprocessor Definitions edit box. This ensures that the definitions and declarations used in SILVER.H and its included files are correct for SilverEngine applications.
  • Since the CWinApp-derived class serves as a global container for the application, it is a natural place to put SilverEngine initialization code.
  • The CView-derived classes are where much of the display is handled, and so it’s natural to handle the SilverScreen Display Context operations there.

Note that it is usually not necessary to explicitly add the SilverEngine export library to your link command. The SILVER.H file contains Visual C++ pragmas that cause the compiler to add the appropriate link commands implicitly.

CWinApp Modifications

In the implementation file (.CPP) for your CWinApp-derived class, find the InitInstance method. The following code should be placed at the top:

   EngineInitStruct eis;
   eis.bits = EI_USE_ENV;
   strcpy( eis.env_file, "silver" );
   engine_initialize( &eis );

At the bottom, once the main frame window has been created, place the following code:

   CFrameWnd *f = (CFrameWnd *) AfxGetMainWnd();
   engine_set_frame_window( f->m_hWnd );

Now find the ExitInstance method. Place the following code before the return statement:

   ss_command( "clear" );    // Clear all drawings.
   ss_command( "quit all" ); // Perform cleanup and
                             // exit SilverEngine.

CView Modifications

The CView-derived class is where a lot of the action happens. In its header file, find the Implementation section, and add a bit of code:

   // Implementation
   public:
      SDC SDCHandle;
      HBITMAP refresh_bitmap;
      HBITMAP old_bitmap;
      HDC refresh_dc;

Now go to the implementation (.CPP) file. In the constructor for your CView-derived class, add the following initializations:

   SDCHandle = 0;
   refresh_bitmap = 0;
   old_bitmap = 0;
   refresh_dc = 0;

These member variables must also be cleaned up on destruction. Therefore, in the CView destructor, add the following code:

   if ( SDCHandle )
      {
      sdc_close( SDCHandle );
      ::SelectObject( refresh_dc, old_bitmap );
      ::DeleteObject( refresh_bitmap );
      ::DeleteDC( refresh_dc );
      }

SilverEngine assumes that device contexts used to render into are persistent, i.e. private to the application window class. In order to ensure this, you would usually create the window using the CS_OWNDC class flag. So you should now create a PreCreateWindow method for the CView class, and place the following code before the return statement:

   cs.lpszClass = AfxRegisterWndClass(
      CS_HREDRAW|CS_VREDRAW|CS_OWNDC |CS_DBLCLKS,
      hCursor);

Most likely the best place to manage application/SilverEngine connections is in the CView::OnSize method. This is where we discover the initial size of the SilverEngine window, and the place we need to handle resizing of the refresh bitmap. So create one, and add the following code:

   // In first call to OnSize, dimensions are 0,0
   if ( ! cx && ! cy )
      return;
  
   // get window dimensions
   CRect r;
   GetClientRect( &r );
   HDC dc = GetDC()->m_hDC;
  
   if ( ! SDCHandle ) // engine window hasn’t been created yet
      { // initialize engine display context
      SDCInitStruct sdcis;
      sdcis.hWnd = m_hWnd;
      sdcis.drawDC = dc;
      sdcis.refreshDC = refresh_dc = ::CreateCompatibleDC(dc);
      refresh_bitmap =
         ::CreateCompatibleBitmap( dc, r.Width(), r.Height() );
      old_bitmap =
         (HBITMAP)::SelectObject( refresh_dc, refresh_bitmap );
      SDCHandle = sdc_open( &sdcis );
      }
   else // need to resize the current refresh bitmap
      {
      ::SelectObject( refresh_dc, old_bitmap );
      ::DeleteObject( refresh_bitmap );
      refresh_bitmap =
         ::CreateCompatibleBitmap( dc, r.Width(), r.Height() );
      old_bitmap =
         (HBITMAP)::SelectObject( refresh_dc, refresh_bitmap );
      }
  
   sdc_goto( SDCHandle ); // set SilverEngine context
  
   // ensure that screen size is properly set
   resize_screen( r.left,r.right - 1,r.top,r.bottom - 1,FALSE);
  
   // cause SilverEngine to repaint the current screen
   ss_command( "refresh on" );
  
   Invalidate( FALSE ); // force paint operation
  

Non-MFC Applications

Applications for straight Win32 may also use the SilverEngine. The methodology is similar to that used by MFC programs. The task is to tie a Windows window to a SilverScreen screen. In the example that we provide, we create our window, and use sdc_open to make the connection. We also use the same window be our "frame" window, using engine_set_frame_window.

Assume that we have the following global variables, used for a single-window application:

   static HDC MemDC = NULL;
   static HBITMAP MemBitmap = NULL;
   static HBITMAP OldBitmap = NULL;
   static SDCInitStruct SDCIS;
   static SDC SDCHandle = 0;
  
   static HWND hwndMain;

In the section where we create the window, we can perform SilverEngine initialization:

   hwndMain = CreateWindow(
      ClassName,
      AppName,
      WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_THICKFRAME,
      0, 0, 200, 200,
      NULL, NULL, ghInst, NULL );
  
   if ( ! hwndMain )
      return FALSE;
  
   // Show the window
   ShowWindow(hwndMain, SW_SHOW);
   UpdateWindow(hwndMain);
  
   eis.bits = EI_USE_ENV;
   strcpy(eis.env_file, "silver");
   engine_initialize(&eis);
  
   engine_set_frame_window(hwndMain);

Again, a good place to handle SilverScreen Display Context creation is in the handler for WM_SIZE. This fragment would be for the first time that the window was sized, meaning that it’s when the SDC is created. If the SDC has already been created, then we would want to resize the bitmap associated with the refresh DC:

   if ( ! SDCHandle )
      {
      MemDC = CreateCompatibleDC(hDC);
      MemBitmap = CreateCompatibleBitmap(hDC,
                                         RectWidth(&wRect),
                                         RectHeight(&wRect));
      OldBitmap = (HBITMAP)SelectObject(MemDC, MemBitmap);
      SDCIS.hWnd = hwnd; // Can be NULL if not using
                         // interactive commands or OpenGL
      SDCIS.drawDC = hDC; // Can be NULL if not using
                          // interactive commands
      SDCIS.refreshDC = MemDC;
      SDCHandle = sdc_open(&SDCIS);
      sdc_goto(EngineWindow);
      ss_command("silent screen create");
      }
   else
      {
      SelectObject(MemDC, OldBitmap);
      DeleteObject(MemBitmap);
     
      MemBitmap = CreateCompatibleBitmap( hDC,
                                          RectWidth(&wRect),
                                          RectHeight(&wRect) );
     
      OldBitmap = (HBITMAP)SelectObject(MemDC,MemBitmap);
      }
     
   resize_screen( wRect.left, wRect.right - 1,
   wRect.top, wRect.bottom - 1, FALSE);
   ss_command("refresh all");
   ReleaseDC(hwnd, hDC);

Finally, the WM_PAINT handler refreshes the screen display from the refresh DC:

   RECT wRect;
   if ( SDCHandle )
      {
      GetClientRect(hWnd, &wRect);
     
      BitBlt(hDC,
             wRect.left,
             wRect.top,
             RectWidth(&wRect),
             RectHeight(&wRect),
             MemDC,
             0,
             0,
             SRCCOPY);
      }

 

SilverEngine Functions

The following functions are necessary for SilverEngine development, but are not strictly part of the SilverScreen API. They are declared in the include file SILVERE.H. Note that use of SILVERE.H requires a previous include of SILVER.H, the standard SilverScreen API header file.

sdc_goto
int sdc_goto( SDC handle )
SDC handle; // the Silver display context handle

Synopsis #include "silvere.h"

The sdc_goto function sets the current SilverEngine display context to the context associated with handle.

Parameters handle must have been obtained by a previous call to sdc_open.
Return Value sdc_goto returns 1 if handle refers to a valid SilverEngine display context, and 0 otherwise
Comments A SilverEngine display context refers to a Windows window, its associated DC (Windows device context) and a refresh DC.
See Also sdc_open, sdc_close

sdc_close
int sdc_close( SDC handle )
SDC handle; // the Silver display context handle

Synopsis #include "silvere.h"

The sdc_close function removes the association between the components of a SilverEngine display context handle and SilverEngine. This means that handle may no longer be used in further sdc_goto calls.

Parameters handle must have been obtained by a previous call to sdc_open.
Return Value sdc_close returns 1 if handle refers to a valid SilverEngine display context, and 0 otherwise.
Comments A SilverEngine context refers to a Windows window, its associated DC (Windows device context) and a refresh DC.
See Also sdc_open, sdc_goto

sdc_open
SDC sdc_open( SDCInitStruct *sdcis )
SDCInitStruct *sdcis; // SilverEngine display context components

Synopsis #include "silvere.h"

The sdc_open function makes a connection between SilverEngine display context components and SilverEngine.

Parameters sdcis is a pointer to an SDCInitStruct that has its members filled appropriately.

   typedef struct
      {
      HWND hWnd;
      HDC drawDC;
      HDC refreshDC;
      } SDCInitStruct;
 

hWnd should be the Windows handle of a valid Windows window. drawDC should be the Windows handle of a valid Windows device context. For use with display device contexts, drawDC should be a private device context, i.e. a device context derived from a window whose window class style was specified with the CS_OWNDC style bit. refreshDC should be the Windows handle of a valid Windows device context.

Return Value sdc_open returns a handle of type SDC that is non-zero if the connection can be made successfully, and 0 otherwise.
Comments A SilverEngine display context refers to a Windows window, its associated DC (Windows device context) and a refresh DC. The supplied window is subclassed by SilverEngine so that SilverScreen input events may be returned via inchar and nextkey.
See Also sdc_goto, sdc_close

engine_initialize
int engine_initialize( EngineInitStruct *ewis )
EngineInitStruct *eis; // SilverEngine initialization components

Synopsis #include "silvere.h"

The engine_initialize function prepares SilverEngine for use by an application.

Parameters ewis is a pointer to an EngineInitStruct that has its members filled appropriately.

// bits for SWInitStruct type field
#define EI_USE_ENV 1 // use env file for initialization
#define EI_USE_PATHS 2 // use user-supplied bitmap

typedef struct
   {
   USINT bits;
   char env_file[THIS_COMMAND_SIZE];
   char path_exec[THIS_COMMAND_SIZE];
   char path_drawing[THIS_COMMAND_SIZE];
   char path_library[THIS_COMMAND_SIZE];
   } EngineInitStruct;
 

bits specifies the method that is to be used to initialize SilverEngine. If bits is equal to EI_USE_ENV, then a SilverScreen environment file will be used to initialize SilverEngine. In this case, env_file must contain the name of a SilverScreen environment file. The effect is as if the following command was executed.:

   ss_command("startup private open %s",env_file);

If bits is equal to EI_USE_PATHS, then path_exec, path_drawing and path_library must contain the names of directories where SilverEngine is to find executable files, drawing and libraries, respectively. The effect in this case is as if the following commands were executed:

   ss_command("file path execution %s",path_exec);
   ss_command("file path drawing %s",path_drawing);
   ss_command("file path library %s",path_library);

Return Value engine_initialize returns 1 if the initialization succeeded, and 0 otherwise.

 

engine_set_frame_window
int engine_set_frame_window( HWND user_frame_window )
HWND user_frame_window; // window handle of frame window

Synopsis #include "silvere.h"

The engine_set_frame_window function provides SilverEngine with a frame window that it can use to attach user interface items.

Parameters user_frame_window is a Windows handle to a frame window.
Return Value engine_set_frame_window returns 1 if the initialization succeeded, and 0 otherwise.
Comments The supplied frame window is subclassed by SilverEngine so that SilverScreen input events may be returned via inchar and nextkey.

 

Technical Notes

Implementation Notes

  • SilverEngine is implemented as a Win32 DLL, built using Microsoft Visual C++. Its API (functions and data) are exported using the VC++ __declspec(dllexport) specification.
  • Packing for SilverC structures and the SilverScreen API is 4 bytes. Using the SilverEngine include files SILVER.H or SSNODES.H ensures that proper packing values are used by the compiler.
  • SilverEngine subclasses various windows as a result of calling its API functions. This allows SilverEngine to support use of inchar and nextkey in client applications. In particular, SilverEngine subclasses the window associated with the handles passed to engine_set_frame_window and sdc_open.

Non-Graphical Use of SilverEngine

Use of SilverEngine without using its display capabilities (that is, without using sdc_open, sdc_close or sdc_goto) should be possible; however, we have not verified this and have no examples.

Other Compilers

Use of SilverEngine with applications built by other compilers has never been verified. Theoretically it should be possible, but it is almost certain that various incompatibilities will occur.

SilverEngine Components

Core Components

The following DLLs are provided for base SilverEngine support:

ENGINE.DLL Main SilverScreen DLL
BTREE.DLL BTree functionality
KEYWORD.DLL SilverScreen command keyword DLL

The following DLLs are debug versions of the above DLLs. Using SILVER.H, and defining of the _DEBUG preprocessor will cause the appropriate DLLs to be referenced.

ENGINED.DLL Main SilverScreen DLL, debug version
BTREED.DLL BTree functionality, debug version
KEYWORDD.DLL SilverScreen command keyword DLL, debug version

Support Files

The following files are needed for either compiling or running SilverEngine applications:

SILVER.H Main header file for use with SilverScreen. Defines SilverScreen APIs. For SilverEngine development purposes, must be used with macro SILVERENGINE_CLIENT_BUILD defined. SILVER.H does a lot of the work needed to successfully compile SilverC, SilverScreen DLL or SilverEngine applications: it includes SSDEF.H, SSNODES.H, SSKEYS.H and SSLOAD.H in the proper order.
SILVERE.H Header file containing functions and definitions specific to SilverEngine applications.
SSNODES.H Header file containing definitions pertaining to SilverScreen geometry data structures.
SSDEF.H Header file containing basic SilverScreen definitions.
SILVER2.H Include file for backwards compatibility to older REX/DLL applications.
SSKEYS.H Header file containing SilverScreen key and mouse event definitions, as returned by SilverScreen functions inchar and nextkey.
SSLOAD.H Header file containing definitions and declarations associated with the ss_load function API. This set of functions was used in earlier versions of SilverScreen, but is now considered obsolete, though still supported.
SILVER.SSM Contains popup menus for SilverEngine user interface support.
ENGINE.TXT Contains SilverEngine error messages and other text.
SILVER.ENV Prototype SilverScreen environment file.

Microsoft DLLs

Since the SilverEngine is built using Microsoft’s Microsoft Foundation Classes, the libraries that implement MFC are needed:

MSVCRT.DLL Microsoft C Runtime library
MSVCRTD.DLL Debug version of Microsoft C Runtime library
MFC42.DLL MFC library
MFC42D.DLL Debug version of MFC library
OPENGL.DLL
GLU32.DLL
OpenGL rendering support libraries

LeadTools DLLs

SilverScreen and SilverEngine use the LeadTools toolset to import and export various file types. The following are the LeadTools DLLs distributed with SilverEngine:

LTKRN70N.DLL
LTFIL70N.DLL
LFBMP70N.DLL
LFCMP70N.DLL
LFEPS70N.DLL
LFTIF70N.DLL
LFFAX70N.DLL
LFMSP70N.DLL
LFPCD70N.DLL
LFPCX70N.DLL
LFPSD70N.DLL
LFWMF70N.DLL
LFGIF70N.DLL
LFTGA70N.DLL

Crypto32 Component

SilverScreen is currently able to use the Crypto32 software locking system The following DLL must be available so that Crypto32 may be used.

CRYPTO32.DLL

Sentinel Components

The SilverEngine may use the Rainbow Sentinel hardware locking system. The following Windows driver must be installed in order for SilverEngine to use this system.

SENTINEL.VXD

 

Sample Projects

As part of the SilverEngine development kit, we include several small sample projects in order to demonstrate use of SilverEngine and various SilverC techniques. All of the samples are shipped as Visual C++ projects. In order that the samples build correctly, you should install Visual C++, and ensure that the environment variable MSVCDIR is set on system startup. This is usually accomplished by running the VCVARS32.BAT file, as supplied by the Visual C++ installation. Note that all of these projects use the SILVER environment variable as a target to copy the generated executable.

MFC MDI

SSMDI project

Installed into: <silver>\Samples\SilverEngine\SSMDI

The SSMDI project is a simple MFC MDI application that is intended to demonstrate basic SilverEngine application setup.

SDCPrint project

Installed into: <silver>\Samples\SilverEngine\SDCPrint

The SDCPrint projected is intended to demonstrate printing with SilverEngine, using SilverScreen script commands like PRINT INTERACTIVE SCREEN, ICOMMAND PAGE SETUP and ICOMMAND PRINT SETUP.

MFCPrint project

Installed into: <silver>\Samples\SilverEngine\SDCPrint

The MFCPrint projected is intended to demonstrate printing with SilverEngine, using the MFC print architecture (CView::OnPrint, CPrintDialog, CPageSetupDialog). The printed output is composed onto the print DC by using the SilverScreen function print_scene.

Win32

Win32 Project

Installed into: <silver>\Samples\SilverEngine\Win32

The Win32 project is intended to demonstrate use of the SilverEngine in a Win32 application, without use of MFC.

 

Copyright

Copyright 1999 by Schroff Development Corporation, Shawnee-Mission, Kansas, United States of America. All rights reserved.

 

Disclaimer of All Warranties and Liability

Schroff Development Corporation makes no warranties, either express or implied, with respect to this document or with respect to the hardware and software described in this document. Schroff Development Corporation does not guarantee, warrant or make any representation regarding the use of, or the results of the use of the information in terms of correctness, accuracy, reliability, or performance. Schroff Development Corporation assumes no liability for any direct, indirect, or consequential, special or exemplary damages, regardless of its having been advised of the possibility of such damage.