LVectorWindow::SetEngine

#include "ltwrappr.h"

static L_INT LVectorWindow::SetEngine(nEngine=VECTOR_ENGINE_GDI, dwFlags=VECTOR_ENGINE_DOUBLEBUFFER)

L_INT nEngine;

/* vector engine */

L_UINT32 dwFlags;

/* flags */

Sets the vector engine to use when rendering vector images.

Parameter

Description

nEngine

Value that specifies which vector engine to use. Possible values are:

 

Value

Meaning

 

VECTOR_ENGINE_GDI

Use GDI rendering. (No lights and shading).

 

VECTOR_ENGINE_OPENGL

Use OpenGL rendering.

dwFlags

Flags that modify the vector engine. Possible values are:

 

Value

Meaning

 

VECTOR_ENGINE_DOUBLEBUFFER

Use double buffering when the vector image is attached to a window.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Loads one of the supported vector engines.

After the VECTOR engine is successfully loaded, all subsequent calls to the VECTOR functions will use this engine for rendering the vector image.

Note: OpenGL and DirectX do not support the drawing of 2D objects (Text and Ellipses).

Note: OpenGL and DirectX engines will not work in a palettized screen mode (256-colors or less). This function will fail, and return a value of ERROR_INV_PARAMETER if you try to use either of these engines in 256 color- mode or less.

Attempting to change the vector engine will fail with WRPERR_VECTOR_ALREADY_LOADED if a vector is currently loaded into a LVectorWindow object.

Different vectors can have different engines within the same application.

The default engine is the GDI.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LVectorBase::GetEngine, Class Members

Example

//This example assumes pVectorWindow points to a valid LVectorWindow object.
//This example sets the vector engine to 'nEngine', and displays an error message
//on failure

L_BOOL Example18(HWND hWndParent, LVectorWindow *pVectorWindow, L_INT nEngine)
{
   L_TCHAR L_FAR *lpszEngine;
   L_TCHAR szTemp[100];
   L_INT  nRet;

   L_UINT32 dwFlags = VECTOR_ENGINE_DOUBLEBUFFER;

   nRet = pVectorWindow->SetEngine(nEngine, dwFlags);
   if (nRet != SUCCESS )

   {
      lpszEngine = TEXT("");
      switch (nEngine)
      {
      case VECTOR_ENGINE_GDI:
            lpszEngine = TEXT("GDI");
            break;

      case VECTOR_ENGINE_OPENGL:
            lpszEngine = TEXT("OpenGL");
            break;
      }
      wsprintf(szTemp, TEXT("[%s] failed to load"), lpszEngine);
      MessageBox(hWndParent, szTemp, TEXT(""), MB_OK);
      return FALSE;   

   }
   return TRUE;
}