Click here to Skip to main content
15,898,371 members
Home / Discussions / Graphics
   

Graphics

 
Questiongraphics Pin
jarwa4-Aug-08 1:15
jarwa4-Aug-08 1:15 
AnswerRe: graphics Pin
Harvey Saayman4-Aug-08 4:51
Harvey Saayman4-Aug-08 4:51 
QuestionSkin Desktop Application in .Net Framework 2.0 Pin
sudjp4-Aug-08 1:02
sudjp4-Aug-08 1:02 
AnswerRe: Skin Desktop Application in .Net Framework 2.0 Pin
John_Adams5-Aug-08 3:16
John_Adams5-Aug-08 3:16 
GeneralRe: Skin Desktop Application in .Net Framework 2.0 Pin
sudjp5-Aug-08 17:53
sudjp5-Aug-08 17:53 
GeneralRe: Skin Desktop Application in .Net Framework 2.0 Pin
sudjp5-Aug-08 18:18
sudjp5-Aug-08 18:18 
AnswerRe: Skin Desktop Application in .Net Framework 2.0 Pin
Member 34802328-Aug-08 3:46
Member 34802328-Aug-08 3:46 
QuestionOpenGL better alternative to wglUseFontBitmaps ? Pin
Maximilien31-Jul-08 8:27
Maximilien31-Jul-08 8:27 
I'm trying to figure some memory issues with wglUseFontBitmaps.

When setting the "hardware acceleration" to none in the display settings:

In our legacy software, when using wglUseFontBitmaps there is a lot of "Virtual Memory" (in the task manager) being eaten up (600megs!).

When doing the same thing in a test program, I get around only 40 megs for the same fonts (size and pitch and weight, ... ).

Are there factors that can affect the virtual memory footprint of my application in regards of OpenGL bitmap fonts ?

Here is our pixel format of OpenGL (simple, basic and straightforward)
  bool bErrFound = false;
  PIXELFORMATDESCRIPTOR pixelDesc;

  pixelDesc.nSize = sizeof(PIXELFORMATDESCRIPTOR);
  pixelDesc.nVersion = 1;

  pixelDesc.dwFlags           =       dwFlags;//PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER
  pixelDesc.iPixelType    =       PFD_TYPE_RGBA;      // RGBA type

  pixelDesc.cColorBits        = 24;                   // 24-bit color depth
pixelDesc.cRedBits            = 0;
  pixelDesc.cRedShift         = 0;
  pixelDesc.cGreenBits        = 0;
  pixelDesc.cGreenShift       = 0;
  pixelDesc.cBlueBits         = 0;
  pixelDesc.cBlueShift        = 0;
  pixelDesc.cAlphaBits        = 0;
  pixelDesc.cAlphaShift       = 0;

  pixelDesc.cAccumBits            = 0;
  pixelDesc.cAccumRedBits     = 0;
  pixelDesc.cAccumGreenBits = 0;
  pixelDesc.cAccumBlueBits    = 0;
  pixelDesc.cAccumAlphaBits = 0;

  pixelDesc.cDepthBits        = 16;               // 24-bit z-buffer
  pixelDesc.cStencilBits  = 0;                // 8-bit stencil buffer
  pixelDesc.cAuxBuffers       = 0;                // no auxiliary buffer

  pixelDesc.iLayerType        = PFD_MAIN_PLANE;
  pixelDesc.bReserved         = 0;
  pixelDesc.dwLayerMask       = 0;
  pixelDesc.dwVisibleMask = 0;
  pixelDesc.dwDamageMask  = 0;

  int iPixelIndex = ::ChoosePixelFormat( hDC, &pixelDesc );
  if( iPixelIndex == 0 ) // Choose default
  {
      iPixelIndex = 1;
  }

  if( ::DescribePixelFormat( hDC, iPixelIndex, sizeof(PIXELFORMATDESCRIPTOR), &pixelDesc) != 0 )
  {
      if( !::SetPixelFormat( hDC, iPixelIndex, &pixelDesc ) )
          bErrFound = true;
  }
  else
      bErrFound = true;


and the fonts are created like this (one of 6 font)
strcpy(logfont.lfFaceName, "Arial");

logfont.lfHeight                = 24;
logfont.lfWidth                 = 0;
logfont.lfEscapement        = 0;
logfont.lfOrientation       = logfont.lfEscapement;
logfont.lfWeight                = FW_NORMAL;
logfont.lfItalic                = FALSE;
logfont.lfUnderline     = FALSE;
logfont.lfStrikeOut     = FALSE;
logfont.lfCharSet               = ANSI_CHARSET;
logfont.lfOutPrecision  = OUT_DEFAULT_PRECIS;
logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
logfont.lfQuality               = DEFAULT_QUALITY;
logfont.lfPitchAndFamily = FF_DONTCARE | DEFAULT_PITCH;

hBigFont = CreateFontIndirect(&logfont);

if ( hBigFont == NULL)
{
    glLargeFontBitmapListBase = 0; // redundant, but for clarity; should warn user
}
else
{
    HFONT oldHFont = (HFONT) SelectObject(hDC, hBigFont);
    glLargeFontBitmapListBase = ::glGenLists(224);
    IW_ASSERT(IsNoGLError());
    if ( glLargeFontBitmapListBase)
    {
        ::wglUseFontBitmaps(hDC, 32, 224, glLargeFontBitmapListBase);
    }
    else
    {
        //IW_ASSERT (logfile);
        //fprintf(logfile, "Unable to create large OpenGL bitmap fonts\n");
    }
    SelectObject(hDC, oldHFont );
   }


Thanks for any tips, hints or anything I could have forgotten.

Max.



AnswerRe: OpenGL better alternative to wglUseFontBitmaps ? Pin
El Corazon4-Aug-08 18:40
El Corazon4-Aug-08 18:40 
GeneralRe: OpenGL better alternative to wglUseFontBitmaps ? Pin
Maximilien5-Aug-08 3:03
Maximilien5-Aug-08 3:03 
QuestionAdd animated gif to smart device Pin
Dushan12331-Jul-08 7:04
Dushan12331-Jul-08 7:04 
AnswerRe: Add animated gif to smart device [modified] Pin
Iain Clarke, Warrior Programmer1-Aug-08 0:03
Iain Clarke, Warrior Programmer1-Aug-08 0:03 
QuestionIs it possible to avoid decimation when drawing a bitmap? Pin
Jim Warburton30-Jul-08 4:31
Jim Warburton30-Jul-08 4:31 
QuestionRe: Is it possible to avoid decimation when drawing a bitmap? Pin
Mark Salsbery30-Jul-08 7:55
Mark Salsbery30-Jul-08 7:55 
AnswerRe: Is it possible to avoid decimation when drawing a bitmap? Pin
Jim Warburton30-Jul-08 14:12
Jim Warburton30-Jul-08 14:12 
GeneralRe: Is it possible to avoid decimation when drawing a bitmap? Pin
Mark Salsbery30-Jul-08 14:25
Mark Salsbery30-Jul-08 14:25 
QuestionRe: Is it possible to avoid decimation when drawing a bitmap? Pin
Mark Salsbery30-Jul-08 14:44
Mark Salsbery30-Jul-08 14:44 
AnswerRe: Is it possible to avoid decimation when drawing a bitmap? Pin
Jim Warburton31-Jul-08 1:11
Jim Warburton31-Jul-08 1:11 
GeneralRe: Is it possible to avoid decimation when drawing a bitmap? Pin
Mark Salsbery31-Jul-08 7:15
Mark Salsbery31-Jul-08 7:15 
GeneralRe: Is it possible to avoid decimation when drawing a bitmap? Pin
Jim Warburton1-Aug-08 0:03
Jim Warburton1-Aug-08 0:03 
GeneralOpenGL : glGenLists fails (GL_INVALID_OPERATION) (RESOLVED) [modified] Pin
Maximilien29-Jul-08 3:26
Maximilien29-Jul-08 3:26 
QuestionGdiplus::Bitmap destruction crash Pin
Alain Rist28-Jul-08 2:36
Alain Rist28-Jul-08 2:36 
QuestionRe: Gdiplus::Bitmap destruction crash Pin
Mark Salsbery28-Jul-08 7:09
Mark Salsbery28-Jul-08 7:09 
AnswerRe: Gdiplus::Bitmap destruction crash [modified] Pin
Alain Rist28-Jul-08 7:44
Alain Rist28-Jul-08 7:44 
GeneralRe: Gdiplus::Bitmap destruction crash Pin
Mark Salsbery28-Jul-08 7:57
Mark Salsbery28-Jul-08 7:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.