Display problems in Vista - Graphics

This is a discussion on Display problems in Vista - Graphics ; Hi, I realize that this problem involves Vista, but there is an (equal) OpenGL element, so I posted it here. Sorry if it appears to be off-topic. I have a simple, single dialog application that displays an OpenGL area with ...

+ Reply to Thread
Page 1 of 5 1 2 3 ... LastLast
Results 1 to 10 of 46

Display problems in Vista

  1. Default Display problems in Vista

    Hi,

    I realize that this problem involves Vista, but there is an (equal) OpenGL
    element, so I posted it here. Sorry if it appears to be off-topic.

    I have a simple, single dialog application that displays an OpenGL area with
    a cheesy car drawn on it. The area is known to my application as an
    instance of a CStatic subclass I created called CTestPane. When I create
    this CTestPane instance with a rect of 0, 0, 520, 300 (left, top, right,
    bottom), the area, cleared in black, appears with the cheesy red car. If,
    instead, I use a rect of 20, 20, 520, 300, no image appears at all.

    Now, before anyone assumes this is a problem with your humble programmer, I
    want to point out that if I turn off Desktop Composition for the
    application, it works fine. I know, the problem is probably still me, but I
    just wanted to point that out.

    As for some background, I created this app to try to debug a problem we are
    having with our actual product (much more interesting than my sample app!).
    Some of our OpenGL panes have "dead" areas in them (bands of the Windows
    background color), and some panes do not show up at all. Once again, with
    Desktop Composition turned off, all these problems go away, but this is not
    really a long term option for us.

    I have included the implementation for my CTestPane below. As I mentioned,
    creating this pane with

    m_ctrlPane.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(0, 0, 520, 300),
    this);

    displays the image as expected. Making the simple change to

    m_ctrlPane.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(20, 20, 520, 300),
    this);

    results in nothing being displayed on the main dialog.

    More information. This sample app (and our actual product) works fine on a
    Vista eMachines PC with an NVIDIA GeForce 6100. Where it is not working is
    on my development laptop with Intel graphics. We saw similar problems with
    a desktop PC as well, but I don't have the specs for it.

    Thanks for any help you can provide!

    JAB

    // TestPane.cpp : implementation file
    //

    #include "stdafx.h"
    #include "OpenGLVistaTestSimple.h"
    #include "TestPane.h"

    #include <gl/gl.h>
    #include <gl/glu.h>

    #include <math.h>

    #ifdef _DEBUG
    #define new DEBUG_NEW
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;
    #endif

    BOOL CTestPane::m_bWindowClassRegistered = RegisterWindowClass();

    /////////////////////////////////////////////////////////////////////////////
    // CTestPane

    CTestPane::CTestPane()
    : m_pDC(NULL)
    {
    }

    CTestPane::~CTestPane()
    {
    }


    BEGIN_MESSAGE_MAP(CTestPane, CStatic)
    //{{AFX_MSG_MAP(CTestPane)
    ON_WM_PAINT()
    ON_WM_CREATE()
    ON_WM_ERASEBKGND()
    //}}AFX_MSG_MAP
    END_MESSAGE_MAP()

    /////////////////////////////////////////////////////////////////////////////
    // CTestPane message handlers

    void CTestPane::OnPaint()
    {
    CPaintDC dc(this); // device context for painting

    if ( m_pDC != NULL )
    {
    BOOL bResult = wglMakeCurrent(m_pDC->m_hDC, m_hRC);
    if ( bResult )
    {
    glClearColor(0.0, 0.0, 0.0, 1.0);
    glClear(GL_COLOR_BUFFER_BIT);

    glClearDepth(1.0f);

    CRect rectPane;
    GetClientRect(rectPane);

    // Select the projection matrix and reset
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();

    // Set the drawing area
    glViewport(rectPane.left,
    rectPane.top,
    rectPane.Width(),
    rectPane.Height());

    gluOrtho2D(0, 1000, 0, 1000.0 * (double)rectPane.Height() /
    (double)rectPane.Width());

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

    glLineWidth(1.0);
    glColor3d(1.0, 0.0, 0.0);

    glBegin(GL_LINES);
    Line(110, 230, 210, 230);
    Arc(210, 230, 260, 230, -180);
    Line(310, 230, 510, 230);
    Arc(510, 230, 560, 230, -180);
    Line(610, 230, 710, 230);
    Line(710, 230, 710, 270);
    Line(710, 270, 630, 300);
    Line(630, 300, 110, 300);
    Line(590, 300, 550, 350);
    Line(550, 350, 250, 350);
    Line(250, 350, 210, 300);
    Line(110, 300, 110, 230);

    Line(210, 300, 250, 280);
    Line(310, 240, 510, 240);
    Line(570, 280, 590, 300);
    Line(410, 350, 410, 240);

    Arc(215, 230, 260, 230, 360);
    Arc(515, 230, 560, 230, 360);
    glEnd();

    SwapBuffers(m_pDC->m_hDC);

    wglMakeCurrent(NULL, NULL);
    }
    }

    // Do not call CStatic::OnPaint() for painting messages
    }

    //***********************************************************************
    void CTestPane::Line(double dXStart, double dYStart, double dXEnd, double
    dYEnd)
    {
    glVertex2d(dXStart, dYStart);
    glVertex2d(dXEnd, dYEnd);
    }

    //***********************************************************************
    void CTestPane::Arc(double dXStart, double dYStart, double dXCenter, double
    dYCenter, double dDegrees)
    {
    static const double PI = 3.1415926;

    double dResolution = 10.0 * PI / 180.0;

    double dRadius = sqrt((dXStart - dXCenter) * (dXStart - dXCenter) +
    (dYStart - dYCenter) * (dYStart - dYCenter));

    double dStartAngle = atan2(dYStart - dYCenter, dXStart - dXCenter);
    double dEndAngle = dStartAngle + dDegrees * PI / 180.0;
    bool bIncreasing = dDegrees > 0;
    if ( bIncreasing && dEndAngle < dStartAngle )
    {
    dEndAngle += 2 * PI;
    }
    else if ( !bIncreasing && dEndAngle > dStartAngle )
    {
    dEndAngle -= 2 * PI;
    }

    if ( !bIncreasing )
    {
    dResolution = -dResolution;
    }
    double dAngle = dStartAngle;
    double dXBegin = dXStart;
    double dYBegin = dYStart;
    while ( (bIncreasing && dAngle < dEndAngle) || (!bIncreasing && dAngle >
    dEndAngle) )
    {
    double dXEnd = dRadius * cos(dAngle) + dXCenter;
    double dYEnd = dRadius * sin(dAngle) + dYCenter;

    glVertex2d(dXBegin, dYBegin);
    glVertex2d(dXEnd, dYEnd);

    dAngle += dResolution;
    dXBegin = dXEnd;
    dYBegin = dYEnd;
    }
    }

    //***********************************************************************
    BOOL CTestPane::RegisterWindowClass()
    {
    // Register our Pane window class. This is necessary because we need
    // to add the class style CS_OWNDC for this window to work with OpenGL
    WNDCLASSEX classInfoPane;
    classInfoPane.cbSize = sizeof(WNDCLASSEX);
    classInfoPane.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
    classInfoPane.lpfnWndProc = (WNDPROC)CTestPane::PaneWndProc;
    classInfoPane.cbClsExtra = 0;
    classInfoPane.cbWndExtra = 0;
    classInfoPane.hInstance = GetModuleHandle(NULL);
    classInfoPane.hIcon = NULL;
    classInfoPane.hCursor = NULL;
    classInfoPane.hbrBackground = 0;
    classInfoPane.lpszMenuName = NULL;
    classInfoPane.lpszClassName = _TEXT("TestClass");
    classInfoPane.hIconSm = NULL;
    BOOL bResult = RegisterClassEx(&classInfoPane);
    if ( !bResult )
    {
    TRACE("Unable to register TestClass\n");
    }

    return bResult;
    }

    //***********************************************************************
    long CTestPane::PaneWndProc(HWND hwnd, UINT message, DWORD wParam, LONG
    lParam)
    {
    return :efWindowProc(hwnd, message, wParam, lParam);
    }

    //***********************************************************************
    BOOL CTestPane::PreCreateWindow(CREATESTRUCT& cs)
    {
    cs.lpszClass = _TEXT("TestClass");

    return CStatic::PreCreateWindow(cs);
    }

    //***********************************************************************
    int CTestPane::OnCreate(LPCREATESTRUCT lpCreateStruct)
    {
    int iRetVal = CStatic::OnCreate(lpCreateStruct);
    if ( iRetVal != -1 )
    {
    // Set up OpenGL
    // Describe the pixel format
    PIXELFORMATDESCRIPTOR pfd;
    memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
    pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
    pfd.nVersion = 1;
    pfd.dwFlags = PFD_DOUBLEBUFFER |
    PFD_SUPPORT_OPENGL |
    PFD_DRAW_TO_WINDOW |
    PFD_SWAP_COPY |
    0x00008000; //PFD_SUPPORT_COMPOSITION;
    pfd.iPixelType = PFD_TYPE_RGBA;
    pfd.cColorBits = 24;
    pfd.cDepthBits = 32;
    pfd.iLayerType = PFD_MAIN_PLANE;

    // Resolve the pixel format against the current drivers
    m_pDC = GetDC();
    int nPixelFormat = ChoosePixelFormat(m_pDC->m_hDC, &pfd);
    if (nPixelFormat == 0)
    {
    TRACE("ChoosePixelFormat Failed %d\r\n",GetLastError());
    iRetVal = -1;
    }
    else
    {
    // If we need a palette, punt. Don't want to mess with this!
    if ( (pfd.dwFlags & PFD_NEED_PALETTE) > 0 )
    {
    TRACE("We need a palette!!\r\n");
    iRetVal = -1;
    }
    else
    {
    // Set the pixel format
    BOOL bResult = SetPixelFormat(m_pDC->m_hDC, nPixelFormat, &pfd);
    if ( bResult )
    {
    // Create a rendering context for OpenGL
    m_hRC = wglCreateContext(m_pDC->m_hDC);
    if (m_hRC == NULL)
    {
    TRACE("Unable to create a rendering context: %d\r\n",GetLastError());
    iRetVal = -1;
    }
    }
    else
    {
    TRACE("SetPixelFormat Failed %d\r\n",GetLastError());
    iRetVal = -1;
    }
    }
    }
    }

    return iRetVal;
    }


  2. Default Re: Display problems in Vista

    The window creation is missing WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles.
    OpenGL requires these on Windows.

    To use double buffering glDrawBuffer(GL_BACK); needs to be called before
    the primitives are drawn so that the SwapBuffers call works. Otherwise, the
    code is drawing to whatever buffer is default (possibly the front one) and
    then swapping the back buffer over the front. Result: no picture.

    HTH,

    Elaine

    "John A. Byerly" <jbyerly@essDASHqualityDOTcom> wrote in message
    news:IScNi.5444$6Y5.2084@trnddc07...
    > Hi,
    >
    > I realize that this problem involves Vista, but there is an (equal) OpenGL
    > element, so I posted it here. Sorry if it appears to be off-topic.
    >
    > I have a simple, single dialog application that displays an OpenGL area
    > with
    > a cheesy car drawn on it. The area is known to my application as an
    > instance of a CStatic subclass I created called CTestPane. When I create
    > this CTestPane instance with a rect of 0, 0, 520, 300 (left, top, right,
    > bottom), the area, cleared in black, appears with the cheesy red car. If,
    > instead, I use a rect of 20, 20, 520, 300, no image appears at all.
    >
    > Now, before anyone assumes this is a problem with your humble programmer,
    > I
    > want to point out that if I turn off Desktop Composition for the
    > application, it works fine. I know, the problem is probably still me, but
    > I
    > just wanted to point that out.
    >
    > As for some background, I created this app to try to debug a problem we
    > are
    > having with our actual product (much more interesting than my sample
    > app!).
    > Some of our OpenGL panes have "dead" areas in them (bands of the Windows
    > background color), and some panes do not show up at all. Once again, with
    > Desktop Composition turned off, all these problems go away, but this is
    > not
    > really a long term option for us.
    >
    > I have included the implementation for my CTestPane below. As I
    > mentioned,
    > creating this pane with
    >
    > m_ctrlPane.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(0, 0, 520, 300),
    > this);
    >
    > displays the image as expected. Making the simple change to
    >
    > m_ctrlPane.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(20, 20, 520,
    > 300),
    > this);
    >
    > results in nothing being displayed on the main dialog.
    >
    > More information. This sample app (and our actual product) works fine on
    > a
    > Vista eMachines PC with an NVIDIA GeForce 6100. Where it is not working
    > is
    > on my development laptop with Intel graphics. We saw similar problems
    > with
    > a desktop PC as well, but I don't have the specs for it.
    >
    > Thanks for any help you can provide!
    >
    > JAB
    >
    > // TestPane.cpp : implementation file
    > //
    >
    > #include "stdafx.h"
    > #include "OpenGLVistaTestSimple.h"
    > #include "TestPane.h"
    >
    > #include <gl/gl.h>
    > #include <gl/glu.h>
    >
    > #include <math.h>
    >
    > #ifdef _DEBUG
    > #define new DEBUG_NEW
    > #undef THIS_FILE
    > static char THIS_FILE[] = __FILE__;
    > #endif
    >
    > BOOL CTestPane::m_bWindowClassRegistered = RegisterWindowClass();
    >
    > /////////////////////////////////////////////////////////////////////////////
    > // CTestPane
    >
    > CTestPane::CTestPane()
    > : m_pDC(NULL)
    > {
    > }
    >
    > CTestPane::~CTestPane()
    > {
    > }
    >
    >
    > BEGIN_MESSAGE_MAP(CTestPane, CStatic)
    > //{{AFX_MSG_MAP(CTestPane)
    > ON_WM_PAINT()
    > ON_WM_CREATE()
    > ON_WM_ERASEBKGND()
    > //}}AFX_MSG_MAP
    > END_MESSAGE_MAP()
    >
    > /////////////////////////////////////////////////////////////////////////////
    > // CTestPane message handlers
    >
    > void CTestPane::OnPaint()
    > {
    > CPaintDC dc(this); // device context for painting
    >
    > if ( m_pDC != NULL )
    > {
    > BOOL bResult = wglMakeCurrent(m_pDC->m_hDC, m_hRC);
    > if ( bResult )
    > {
    > glClearColor(0.0, 0.0, 0.0, 1.0);
    > glClear(GL_COLOR_BUFFER_BIT);
    >
    > glClearDepth(1.0f);
    >
    > CRect rectPane;
    > GetClientRect(rectPane);
    >
    > // Select the projection matrix and reset
    > glMatrixMode(GL_PROJECTION);
    > glLoadIdentity();
    >
    > // Set the drawing area
    > glViewport(rectPane.left,
    > rectPane.top,
    > rectPane.Width(),
    > rectPane.Height());
    >
    > gluOrtho2D(0, 1000, 0, 1000.0 * (double)rectPane.Height() /
    > (double)rectPane.Width());
    >
    > glMatrixMode(GL_MODELVIEW);
    > glLoadIdentity();
    >
    > glLineWidth(1.0);
    > glColor3d(1.0, 0.0, 0.0);
    >
    > glBegin(GL_LINES);
    > Line(110, 230, 210, 230);
    > Arc(210, 230, 260, 230, -180);
    > Line(310, 230, 510, 230);
    > Arc(510, 230, 560, 230, -180);
    > Line(610, 230, 710, 230);
    > Line(710, 230, 710, 270);
    > Line(710, 270, 630, 300);
    > Line(630, 300, 110, 300);
    > Line(590, 300, 550, 350);
    > Line(550, 350, 250, 350);
    > Line(250, 350, 210, 300);
    > Line(110, 300, 110, 230);
    >
    > Line(210, 300, 250, 280);
    > Line(310, 240, 510, 240);
    > Line(570, 280, 590, 300);
    > Line(410, 350, 410, 240);
    >
    > Arc(215, 230, 260, 230, 360);
    > Arc(515, 230, 560, 230, 360);
    > glEnd();
    >
    > SwapBuffers(m_pDC->m_hDC);
    >
    > wglMakeCurrent(NULL, NULL);
    > }
    > }
    >
    > // Do not call CStatic::OnPaint() for painting messages
    > }
    >
    > //***********************************************************************
    > void CTestPane::Line(double dXStart, double dYStart, double dXEnd, double
    > dYEnd)
    > {
    > glVertex2d(dXStart, dYStart);
    > glVertex2d(dXEnd, dYEnd);
    > }
    >
    > //***********************************************************************
    > void CTestPane::Arc(double dXStart, double dYStart, double dXCenter,
    > double
    > dYCenter, double dDegrees)
    > {
    > static const double PI = 3.1415926;
    >
    > double dResolution = 10.0 * PI / 180.0;
    >
    > double dRadius = sqrt((dXStart - dXCenter) * (dXStart - dXCenter) +
    > (dYStart - dYCenter) * (dYStart - dYCenter));
    >
    > double dStartAngle = atan2(dYStart - dYCenter, dXStart - dXCenter);
    > double dEndAngle = dStartAngle + dDegrees * PI / 180.0;
    > bool bIncreasing = dDegrees > 0;
    > if ( bIncreasing && dEndAngle < dStartAngle )
    > {
    > dEndAngle += 2 * PI;
    > }
    > else if ( !bIncreasing && dEndAngle > dStartAngle )
    > {
    > dEndAngle -= 2 * PI;
    > }
    >
    > if ( !bIncreasing )
    > {
    > dResolution = -dResolution;
    > }
    > double dAngle = dStartAngle;
    > double dXBegin = dXStart;
    > double dYBegin = dYStart;
    > while ( (bIncreasing && dAngle < dEndAngle) || (!bIncreasing && dAngle >
    > dEndAngle) )
    > {
    > double dXEnd = dRadius * cos(dAngle) + dXCenter;
    > double dYEnd = dRadius * sin(dAngle) + dYCenter;
    >
    > glVertex2d(dXBegin, dYBegin);
    > glVertex2d(dXEnd, dYEnd);
    >
    > dAngle += dResolution;
    > dXBegin = dXEnd;
    > dYBegin = dYEnd;
    > }
    > }
    >
    > //***********************************************************************
    > BOOL CTestPane::RegisterWindowClass()
    > {
    > // Register our Pane window class. This is necessary because we need
    > // to add the class style CS_OWNDC for this window to work with OpenGL
    > WNDCLASSEX classInfoPane;
    > classInfoPane.cbSize = sizeof(WNDCLASSEX);
    > classInfoPane.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
    > classInfoPane.lpfnWndProc = (WNDPROC)CTestPane::PaneWndProc;
    > classInfoPane.cbClsExtra = 0;
    > classInfoPane.cbWndExtra = 0;
    > classInfoPane.hInstance = GetModuleHandle(NULL);
    > classInfoPane.hIcon = NULL;
    > classInfoPane.hCursor = NULL;
    > classInfoPane.hbrBackground = 0;
    > classInfoPane.lpszMenuName = NULL;
    > classInfoPane.lpszClassName = _TEXT("TestClass");
    > classInfoPane.hIconSm = NULL;
    > BOOL bResult = RegisterClassEx(&classInfoPane);
    > if ( !bResult )
    > {
    > TRACE("Unable to register TestClass\n");
    > }
    >
    > return bResult;
    > }
    >
    > //***********************************************************************
    > long CTestPane::PaneWndProc(HWND hwnd, UINT message, DWORD wParam, LONG
    > lParam)
    > {
    > return :efWindowProc(hwnd, message, wParam, lParam);
    > }
    >
    > //***********************************************************************
    > BOOL CTestPane::PreCreateWindow(CREATESTRUCT& cs)
    > {
    > cs.lpszClass = _TEXT("TestClass");
    >
    > return CStatic::PreCreateWindow(cs);
    > }
    >
    > //***********************************************************************
    > int CTestPane::OnCreate(LPCREATESTRUCT lpCreateStruct)
    > {
    > int iRetVal = CStatic::OnCreate(lpCreateStruct);
    > if ( iRetVal != -1 )
    > {
    > // Set up OpenGL
    > // Describe the pixel format
    > PIXELFORMATDESCRIPTOR pfd;
    > memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
    > pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
    > pfd.nVersion = 1;
    > pfd.dwFlags = PFD_DOUBLEBUFFER |
    > PFD_SUPPORT_OPENGL |
    > PFD_DRAW_TO_WINDOW |
    > PFD_SWAP_COPY |
    > 0x00008000; //PFD_SUPPORT_COMPOSITION;
    > pfd.iPixelType = PFD_TYPE_RGBA;
    > pfd.cColorBits = 24;
    > pfd.cDepthBits = 32;
    > pfd.iLayerType = PFD_MAIN_PLANE;
    >
    > // Resolve the pixel format against the current drivers
    > m_pDC = GetDC();
    > int nPixelFormat = ChoosePixelFormat(m_pDC->m_hDC, &pfd);
    > if (nPixelFormat == 0)
    > {
    > TRACE("ChoosePixelFormat Failed %d\r\n",GetLastError());
    > iRetVal = -1;
    > }
    > else
    > {
    > // If we need a palette, punt. Don't want to mess with this!
    > if ( (pfd.dwFlags & PFD_NEED_PALETTE) > 0 )
    > {
    > TRACE("We need a palette!!\r\n");
    > iRetVal = -1;
    > }
    > else
    > {
    > // Set the pixel format
    > BOOL bResult = SetPixelFormat(m_pDC->m_hDC, nPixelFormat, &pfd);
    > if ( bResult )
    > {
    > // Create a rendering context for OpenGL
    > m_hRC = wglCreateContext(m_pDC->m_hDC);
    > if (m_hRC == NULL)
    > {
    > TRACE("Unable to create a rendering context: %d\r\n",GetLastError());
    > iRetVal = -1;
    > }
    > }
    > else
    > {
    > TRACE("SetPixelFormat Failed %d\r\n",GetLastError());
    > iRetVal = -1;
    > }
    > }
    > }
    > }
    >
    > return iRetVal;
    > }
    >




  3. Default Re: Display problems in Vista

    NOSPAM wrote:

    > To use double buffering glDrawBuffer(GL_BACK); needs to be
    > called before the primitives are drawn so that the SwapBuffers
    > call works.


    Only if you've set it to something else beforehand.

    > Otherwise, the code is drawing to whatever buffer is default
    > (possibly the front one)


    By default the back buffer is the drawing target in
    doublebuffered mode.

    > and then swapping the back buffer over the front. Result: no
    > picture.


    Even then you should be able to see a glimpse of the picture
    being rendered. Also the back buffer won't be cleared, so it's
    quite probable that some garbage ends up in the front buffer,
    which YOU CAN SEE.

    Wolfgang Draxinger
    --
    E-Mail address works, Jabber: hexarith@jabber.org, ICQ: 134682867


  4. Default Re: Display problems in Vista


    "NOSPAM" <NeOsSaPcArMeNeO@SkPnAoMlNoOgSyP.AnMet> wrote in message
    news:65d7a$47079453$18d68279$32637@KNOLOGY.NET...
    > The window creation is missing WS_CLIPCHILDREN and WS_CLIPSIBLINGS
    > styles. OpenGL requires these on Windows.


    I thought I had tried this before, but I am out of ideas so I added the
    above styles to my call to Create(). There was no effect.

    > To use double buffering glDrawBuffer(GL_BACK); needs to be called before
    > the primitives are drawn so that the SwapBuffers call works. Otherwise,
    > the code is drawing to whatever buffer is default (possibly the front one)
    > and then swapping the back buffer over the front. Result: no picture.


    GL_BACK is the default for double buffering.

    It almost appears that the problem may be related to the OpenGL support by
    the video system, but there has to be a way to insulate my app from this.

    JAB



  5. Default Re: Display problems in Vista

    Hi,

    I was able to fix the problem by rendering to a DIB section and then BitBlt
    the rendered bitmap. This has actually solved a couple of problems we were
    experiencing.

    JAB

    "John A. Byerly" <jbyerly@essDASHqualityDOTcom> wrote in message
    news:IScNi.5444$6Y5.2084@trnddc07...
    > Hi,
    >
    > I realize that this problem involves Vista, but there is an (equal) OpenGL
    > element, so I posted it here. Sorry if it appears to be off-topic.
    >
    > I have a simple, single dialog application that displays an OpenGL area
    > with
    > a cheesy car drawn on it. The area is known to my application as an
    > instance of a CStatic subclass I created called CTestPane. When I create
    > this CTestPane instance with a rect of 0, 0, 520, 300 (left, top, right,
    > bottom), the area, cleared in black, appears with the cheesy red car. If,
    > instead, I use a rect of 20, 20, 520, 300, no image appears at all.
    >
    > Now, before anyone assumes this is a problem with your humble programmer,
    > I
    > want to point out that if I turn off Desktop Composition for the
    > application, it works fine. I know, the problem is probably still me, but
    > I
    > just wanted to point that out.
    >
    > As for some background, I created this app to try to debug a problem we
    > are
    > having with our actual product (much more interesting than my sample
    > app!).
    > Some of our OpenGL panes have "dead" areas in them (bands of the Windows
    > background color), and some panes do not show up at all. Once again, with
    > Desktop Composition turned off, all these problems go away, but this is
    > not
    > really a long term option for us.
    >
    > I have included the implementation for my CTestPane below. As I
    > mentioned,
    > creating this pane with
    >
    > m_ctrlPane.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(0, 0, 520, 300),
    > this);
    >
    > displays the image as expected. Making the simple change to
    >
    > m_ctrlPane.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(20, 20, 520,
    > 300),
    > this);
    >
    > results in nothing being displayed on the main dialog.
    >
    > More information. This sample app (and our actual product) works fine on
    > a
    > Vista eMachines PC with an NVIDIA GeForce 6100. Where it is not working
    > is
    > on my development laptop with Intel graphics. We saw similar problems
    > with
    > a desktop PC as well, but I don't have the specs for it.
    >
    > Thanks for any help you can provide!
    >
    > JAB
    >
    > // TestPane.cpp : implementation file
    > //
    >
    > #include "stdafx.h"
    > #include "OpenGLVistaTestSimple.h"
    > #include "TestPane.h"
    >
    > #include <gl/gl.h>
    > #include <gl/glu.h>
    >
    > #include <math.h>
    >
    > #ifdef _DEBUG
    > #define new DEBUG_NEW
    > #undef THIS_FILE
    > static char THIS_FILE[] = __FILE__;
    > #endif
    >
    > BOOL CTestPane::m_bWindowClassRegistered = RegisterWindowClass();
    >
    > /////////////////////////////////////////////////////////////////////////////
    > // CTestPane
    >
    > CTestPane::CTestPane()
    > : m_pDC(NULL)
    > {
    > }
    >
    > CTestPane::~CTestPane()
    > {
    > }
    >
    >
    > BEGIN_MESSAGE_MAP(CTestPane, CStatic)
    > //{{AFX_MSG_MAP(CTestPane)
    > ON_WM_PAINT()
    > ON_WM_CREATE()
    > ON_WM_ERASEBKGND()
    > //}}AFX_MSG_MAP
    > END_MESSAGE_MAP()
    >
    > /////////////////////////////////////////////////////////////////////////////
    > // CTestPane message handlers
    >
    > void CTestPane::OnPaint()
    > {
    > CPaintDC dc(this); // device context for painting
    >
    > if ( m_pDC != NULL )
    > {
    > BOOL bResult = wglMakeCurrent(m_pDC->m_hDC, m_hRC);
    > if ( bResult )
    > {
    > glClearColor(0.0, 0.0, 0.0, 1.0);
    > glClear(GL_COLOR_BUFFER_BIT);
    >
    > glClearDepth(1.0f);
    >
    > CRect rectPane;
    > GetClientRect(rectPane);
    >
    > // Select the projection matrix and reset
    > glMatrixMode(GL_PROJECTION);
    > glLoadIdentity();
    >
    > // Set the drawing area
    > glViewport(rectPane.left,
    > rectPane.top,
    > rectPane.Width(),
    > rectPane.Height());
    >
    > gluOrtho2D(0, 1000, 0, 1000.0 * (double)rectPane.Height() /
    > (double)rectPane.Width());
    >
    > glMatrixMode(GL_MODELVIEW);
    > glLoadIdentity();
    >
    > glLineWidth(1.0);
    > glColor3d(1.0, 0.0, 0.0);
    >
    > glBegin(GL_LINES);
    > Line(110, 230, 210, 230);
    > Arc(210, 230, 260, 230, -180);
    > Line(310, 230, 510, 230);
    > Arc(510, 230, 560, 230, -180);
    > Line(610, 230, 710, 230);
    > Line(710, 230, 710, 270);
    > Line(710, 270, 630, 300);
    > Line(630, 300, 110, 300);
    > Line(590, 300, 550, 350);
    > Line(550, 350, 250, 350);
    > Line(250, 350, 210, 300);
    > Line(110, 300, 110, 230);
    >
    > Line(210, 300, 250, 280);
    > Line(310, 240, 510, 240);
    > Line(570, 280, 590, 300);
    > Line(410, 350, 410, 240);
    >
    > Arc(215, 230, 260, 230, 360);
    > Arc(515, 230, 560, 230, 360);
    > glEnd();
    >
    > SwapBuffers(m_pDC->m_hDC);
    >
    > wglMakeCurrent(NULL, NULL);
    > }
    > }
    >
    > // Do not call CStatic::OnPaint() for painting messages
    > }
    >
    > //***********************************************************************
    > void CTestPane::Line(double dXStart, double dYStart, double dXEnd, double
    > dYEnd)
    > {
    > glVertex2d(dXStart, dYStart);
    > glVertex2d(dXEnd, dYEnd);
    > }
    >
    > //***********************************************************************
    > void CTestPane::Arc(double dXStart, double dYStart, double dXCenter,
    > double
    > dYCenter, double dDegrees)
    > {
    > static const double PI = 3.1415926;
    >
    > double dResolution = 10.0 * PI / 180.0;
    >
    > double dRadius = sqrt((dXStart - dXCenter) * (dXStart - dXCenter) +
    > (dYStart - dYCenter) * (dYStart - dYCenter));
    >
    > double dStartAngle = atan2(dYStart - dYCenter, dXStart - dXCenter);
    > double dEndAngle = dStartAngle + dDegrees * PI / 180.0;
    > bool bIncreasing = dDegrees > 0;
    > if ( bIncreasing && dEndAngle < dStartAngle )
    > {
    > dEndAngle += 2 * PI;
    > }
    > else if ( !bIncreasing && dEndAngle > dStartAngle )
    > {
    > dEndAngle -= 2 * PI;
    > }
    >
    > if ( !bIncreasing )
    > {
    > dResolution = -dResolution;
    > }
    > double dAngle = dStartAngle;
    > double dXBegin = dXStart;
    > double dYBegin = dYStart;
    > while ( (bIncreasing && dAngle < dEndAngle) || (!bIncreasing && dAngle >
    > dEndAngle) )
    > {
    > double dXEnd = dRadius * cos(dAngle) + dXCenter;
    > double dYEnd = dRadius * sin(dAngle) + dYCenter;
    >
    > glVertex2d(dXBegin, dYBegin);
    > glVertex2d(dXEnd, dYEnd);
    >
    > dAngle += dResolution;
    > dXBegin = dXEnd;
    > dYBegin = dYEnd;
    > }
    > }
    >
    > //***********************************************************************
    > BOOL CTestPane::RegisterWindowClass()
    > {
    > // Register our Pane window class. This is necessary because we need
    > // to add the class style CS_OWNDC for this window to work with OpenGL
    > WNDCLASSEX classInfoPane;
    > classInfoPane.cbSize = sizeof(WNDCLASSEX);
    > classInfoPane.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
    > classInfoPane.lpfnWndProc = (WNDPROC)CTestPane::PaneWndProc;
    > classInfoPane.cbClsExtra = 0;
    > classInfoPane.cbWndExtra = 0;
    > classInfoPane.hInstance = GetModuleHandle(NULL);
    > classInfoPane.hIcon = NULL;
    > classInfoPane.hCursor = NULL;
    > classInfoPane.hbrBackground = 0;
    > classInfoPane.lpszMenuName = NULL;
    > classInfoPane.lpszClassName = _TEXT("TestClass");
    > classInfoPane.hIconSm = NULL;
    > BOOL bResult = RegisterClassEx(&classInfoPane);
    > if ( !bResult )
    > {
    > TRACE("Unable to register TestClass\n");
    > }
    >
    > return bResult;
    > }
    >
    > //***********************************************************************
    > long CTestPane::PaneWndProc(HWND hwnd, UINT message, DWORD wParam, LONG
    > lParam)
    > {
    > return :efWindowProc(hwnd, message, wParam, lParam);
    > }
    >
    > //***********************************************************************
    > BOOL CTestPane::PreCreateWindow(CREATESTRUCT& cs)
    > {
    > cs.lpszClass = _TEXT("TestClass");
    >
    > return CStatic::PreCreateWindow(cs);
    > }
    >
    > //***********************************************************************
    > int CTestPane::OnCreate(LPCREATESTRUCT lpCreateStruct)
    > {
    > int iRetVal = CStatic::OnCreate(lpCreateStruct);
    > if ( iRetVal != -1 )
    > {
    > // Set up OpenGL
    > // Describe the pixel format
    > PIXELFORMATDESCRIPTOR pfd;
    > memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
    > pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
    > pfd.nVersion = 1;
    > pfd.dwFlags = PFD_DOUBLEBUFFER |
    > PFD_SUPPORT_OPENGL |
    > PFD_DRAW_TO_WINDOW |
    > PFD_SWAP_COPY |
    > 0x00008000; //PFD_SUPPORT_COMPOSITION;
    > pfd.iPixelType = PFD_TYPE_RGBA;
    > pfd.cColorBits = 24;
    > pfd.cDepthBits = 32;
    > pfd.iLayerType = PFD_MAIN_PLANE;
    >
    > // Resolve the pixel format against the current drivers
    > m_pDC = GetDC();
    > int nPixelFormat = ChoosePixelFormat(m_pDC->m_hDC, &pfd);
    > if (nPixelFormat == 0)
    > {
    > TRACE("ChoosePixelFormat Failed %d\r\n",GetLastError());
    > iRetVal = -1;
    > }
    > else
    > {
    > // If we need a palette, punt. Don't want to mess with this!
    > if ( (pfd.dwFlags & PFD_NEED_PALETTE) > 0 )
    > {
    > TRACE("We need a palette!!\r\n");
    > iRetVal = -1;
    > }
    > else
    > {
    > // Set the pixel format
    > BOOL bResult = SetPixelFormat(m_pDC->m_hDC, nPixelFormat, &pfd);
    > if ( bResult )
    > {
    > // Create a rendering context for OpenGL
    > m_hRC = wglCreateContext(m_pDC->m_hDC);
    > if (m_hRC == NULL)
    > {
    > TRACE("Unable to create a rendering context: %d\r\n",GetLastError());
    > iRetVal = -1;
    > }
    > }
    > else
    > {
    > TRACE("SetPixelFormat Failed %d\r\n",GetLastError());
    > iRetVal = -1;
    > }
    > }
    > }
    > }
    >
    > return iRetVal;
    > }
    >



  6. Default Re: Display problems in Vista


    "John A. Byerly" <jbyerly@essDASHquality.com> wrote in message
    news:QGQOi.2517$ln.55@trnddc07...
    > Hi,
    >
    > I was able to fix the problem by rendering to a DIB section and then
    > BitBlt the rendered bitmap. This has actually solved a couple of problems
    > we were experiencing.
    >
    > JAB
    >
    > "John A. Byerly" <jbyerly@essDASHqualityDOTcom> wrote in message
    > news:IScNi.5444$6Y5.2084@trnddc07...
    >> Hi,
    >>
    >> I realize that this problem involves Vista, but there is an (equal)
    >> OpenGL
    >> element, so I posted it here. Sorry if it appears to be off-topic.
    >>
    >> I have a simple, single dialog application that displays an OpenGL area
    >> with
    >> a cheesy car drawn on it. The area is known to my application as an
    >> instance of a CStatic subclass I created called CTestPane. When I create
    >> this CTestPane instance with a rect of 0, 0, 520, 300 (left, top, right,
    >> bottom), the area, cleared in black, appears with the cheesy red car.
    >> If,
    >> instead, I use a rect of 20, 20, 520, 300, no image appears at all.
    >>
    >> Now, before anyone assumes this is a problem with your humble programmer,
    >> I
    >> want to point out that if I turn off Desktop Composition for the
    >> application, it works fine. I know, the problem is probably still me,
    >> but I
    >> just wanted to point that out.
    >>
    >> As for some background, I created this app to try to debug a problem we
    >> are
    >> having with our actual product (much more interesting than my sample
    >> app!).
    >> Some of our OpenGL panes have "dead" areas in them (bands of the Windows
    >> background color), and some panes do not show up at all. Once again,
    >> with
    >> Desktop Composition turned off, all these problems go away, but this is
    >> not
    >> really a long term option for us.
    >>
    >> I have included the implementation for my CTestPane below. As I
    >> mentioned,
    >> creating this pane with
    >>
    >> m_ctrlPane.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(0, 0, 520,
    >> 300),
    >> this);
    >>
    >> displays the image as expected. Making the simple change to
    >>
    >> m_ctrlPane.Create(NULL, WS_VISIBLE | WS_CHILD, CRect(20, 20, 520,
    >> 300),
    >> this);
    >>
    >> results in nothing being displayed on the main dialog.
    >>
    >> More information. This sample app (and our actual product) works fine on
    >> a
    >> Vista eMachines PC with an NVIDIA GeForce 6100. Where it is not working
    >> is
    >> on my development laptop with Intel graphics. We saw similar problems
    >> with
    >> a desktop PC as well, but I don't have the specs for it.
    >>
    >> Thanks for any help you can provide!
    >>
    >> JAB
    >>
    >> // TestPane.cpp : implementation file
    >> //
    >>
    >> #include "stdafx.h"
    >> #include "OpenGLVistaTestSimple.h"
    >> #include "TestPane.h"
    >>
    >> #include <gl/gl.h>
    >> #include <gl/glu.h>
    >>
    >> #include <math.h>
    >>
    >> #ifdef _DEBUG
    >> #define new DEBUG_NEW
    >> #undef THIS_FILE
    >> static char THIS_FILE[] = __FILE__;
    >> #endif
    >>
    >> BOOL CTestPane::m_bWindowClassRegistered = RegisterWindowClass();
    >>
    >> /////////////////////////////////////////////////////////////////////////////
    >> // CTestPane
    >>
    >> CTestPane::CTestPane()
    >> : m_pDC(NULL)
    >> {
    >> }
    >>
    >> CTestPane::~CTestPane()
    >> {
    >> }
    >>
    >>
    >> BEGIN_MESSAGE_MAP(CTestPane, CStatic)
    >> //{{AFX_MSG_MAP(CTestPane)
    >> ON_WM_PAINT()
    >> ON_WM_CREATE()
    >> ON_WM_ERASEBKGND()
    >> //}}AFX_MSG_MAP
    >> END_MESSAGE_MAP()
    >>
    >> /////////////////////////////////////////////////////////////////////////////
    >> // CTestPane message handlers
    >>
    >> void CTestPane::OnPaint()
    >> {
    >> CPaintDC dc(this); // device context for painting
    >>
    >> if ( m_pDC != NULL )
    >> {
    >> BOOL bResult = wglMakeCurrent(m_pDC->m_hDC, m_hRC);
    >> if ( bResult )
    >> {
    >> glClearColor(0.0, 0.0, 0.0, 1.0);
    >> glClear(GL_COLOR_BUFFER_BIT);
    >>
    >> glClearDepth(1.0f);
    >>
    >> CRect rectPane;
    >> GetClientRect(rectPane);
    >>
    >> // Select the projection matrix and reset
    >> glMatrixMode(GL_PROJECTION);
    >> glLoadIdentity();
    >>
    >> // Set the drawing area
    >> glViewport(rectPane.left,
    >> rectPane.top,
    >> rectPane.Width(),
    >> rectPane.Height());
    >>
    >> gluOrtho2D(0, 1000, 0, 1000.0 * (double)rectPane.Height() /
    >> (double)rectPane.Width());
    >>
    >> glMatrixMode(GL_MODELVIEW);
    >> glLoadIdentity();
    >>
    >> glLineWidth(1.0);
    >> glColor3d(1.0, 0.0, 0.0);
    >>
    >> glBegin(GL_LINES);
    >> Line(110, 230, 210, 230);
    >> Arc(210, 230, 260, 230, -180);
    >> Line(310, 230, 510, 230);
    >> Arc(510, 230, 560, 230, -180);
    >> Line(610, 230, 710, 230);
    >> Line(710, 230, 710, 270);
    >> Line(710, 270, 630, 300);
    >> Line(630, 300, 110, 300);
    >> Line(590, 300, 550, 350);
    >> Line(550, 350, 250, 350);
    >> Line(250, 350, 210, 300);
    >> Line(110, 300, 110, 230);
    >>
    >> Line(210, 300, 250, 280);
    >> Line(310, 240, 510, 240);
    >> Line(570, 280, 590, 300);
    >> Line(410, 350, 410, 240);
    >>
    >> Arc(215, 230, 260, 230, 360);
    >> Arc(515, 230, 560, 230, 360);
    >> glEnd();
    >>
    >> SwapBuffers(m_pDC->m_hDC);
    >>
    >> wglMakeCurrent(NULL, NULL);
    >> }
    >> }
    >>
    >> // Do not call CStatic::OnPaint() for painting messages
    >> }
    >>
    >> //***********************************************************************
    >> void CTestPane::Line(double dXStart, double dYStart, double dXEnd, double
    >> dYEnd)
    >> {
    >> glVertex2d(dXStart, dYStart);
    >> glVertex2d(dXEnd, dYEnd);
    >> }
    >>
    >> //***********************************************************************
    >> void CTestPane::Arc(double dXStart, double dYStart, double dXCenter,
    >> double
    >> dYCenter, double dDegrees)
    >> {
    >> static const double PI = 3.1415926;
    >>
    >> double dResolution = 10.0 * PI / 180.0;
    >>
    >> double dRadius = sqrt((dXStart - dXCenter) * (dXStart - dXCenter) +
    >> (dYStart - dYCenter) * (dYStart - dYCenter));
    >>
    >> double dStartAngle = atan2(dYStart - dYCenter, dXStart - dXCenter);
    >> double dEndAngle = dStartAngle + dDegrees * PI / 180.0;
    >> bool bIncreasing = dDegrees > 0;
    >> if ( bIncreasing && dEndAngle < dStartAngle )
    >> {
    >> dEndAngle += 2 * PI;
    >> }
    >> else if ( !bIncreasing && dEndAngle > dStartAngle )
    >> {
    >> dEndAngle -= 2 * PI;
    >> }
    >>
    >> if ( !bIncreasing )
    >> {
    >> dResolution = -dResolution;
    >> }
    >> double dAngle = dStartAngle;
    >> double dXBegin = dXStart;
    >> double dYBegin = dYStart;
    >> while ( (bIncreasing && dAngle < dEndAngle) || (!bIncreasing && dAngle >
    >> dEndAngle) )
    >> {
    >> double dXEnd = dRadius * cos(dAngle) + dXCenter;
    >> double dYEnd = dRadius * sin(dAngle) + dYCenter;
    >>
    >> glVertex2d(dXBegin, dYBegin);
    >> glVertex2d(dXEnd, dYEnd);
    >>
    >> dAngle += dResolution;
    >> dXBegin = dXEnd;
    >> dYBegin = dYEnd;
    >> }
    >> }
    >>
    >> //***********************************************************************
    >> BOOL CTestPane::RegisterWindowClass()
    >> {
    >> // Register our Pane window class. This is necessary because we need
    >> // to add the class style CS_OWNDC for this window to work with OpenGL
    >> WNDCLASSEX classInfoPane;
    >> classInfoPane.cbSize = sizeof(WNDCLASSEX);
    >> classInfoPane.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
    >> classInfoPane.lpfnWndProc = (WNDPROC)CTestPane::PaneWndProc;
    >> classInfoPane.cbClsExtra = 0;
    >> classInfoPane.cbWndExtra = 0;
    >> classInfoPane.hInstance = GetModuleHandle(NULL);
    >> classInfoPane.hIcon = NULL;
    >> classInfoPane.hCursor = NULL;
    >> classInfoPane.hbrBackground = 0;
    >> classInfoPane.lpszMenuName = NULL;
    >> classInfoPane.lpszClassName = _TEXT("TestClass");
    >> classInfoPane.hIconSm = NULL;
    >> BOOL bResult = RegisterClassEx(&classInfoPane);
    >> if ( !bResult )
    >> {
    >> TRACE("Unable to register TestClass\n");
    >> }
    >>
    >> return bResult;
    >> }
    >>
    >> //***********************************************************************
    >> long CTestPane::PaneWndProc(HWND hwnd, UINT message, DWORD wParam, LONG
    >> lParam)
    >> {
    >> return :efWindowProc(hwnd, message, wParam, lParam);
    >> }
    >>
    >> //***********************************************************************
    >> BOOL CTestPane::PreCreateWindow(CREATESTRUCT& cs)
    >> {
    >> cs.lpszClass = _TEXT("TestClass");
    >>
    >> return CStatic::PreCreateWindow(cs);
    >> }
    >>
    >> //***********************************************************************
    >> int CTestPane::OnCreate(LPCREATESTRUCT lpCreateStruct)
    >> {
    >> int iRetVal = CStatic::OnCreate(lpCreateStruct);
    >> if ( iRetVal != -1 )
    >> {
    >> // Set up OpenGL
    >> // Describe the pixel format
    >> PIXELFORMATDESCRIPTOR pfd;
    >> memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
    >> pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
    >> pfd.nVersion = 1;
    >> pfd.dwFlags = PFD_DOUBLEBUFFER |
    >> PFD_SUPPORT_OPENGL |
    >> PFD_DRAW_TO_WINDOW |
    >> PFD_SWAP_COPY |
    >> 0x00008000; //PFD_SUPPORT_COMPOSITION;
    >> pfd.iPixelType = PFD_TYPE_RGBA;
    >> pfd.cColorBits = 24;
    >> pfd.cDepthBits = 32;
    >> pfd.iLayerType = PFD_MAIN_PLANE;
    >>
    >> // Resolve the pixel format against the current drivers
    >> m_pDC = GetDC();
    >> int nPixelFormat = ChoosePixelFormat(m_pDC->m_hDC, &pfd);
    >> if (nPixelFormat == 0)
    >> {
    >> TRACE("ChoosePixelFormat Failed %d\r\n",GetLastError());
    >> iRetVal = -1;
    >> }
    >> else
    >> {
    >> // If we need a palette, punt. Don't want to mess with this!
    >> if ( (pfd.dwFlags & PFD_NEED_PALETTE) > 0 )
    >> {
    >> TRACE("We need a palette!!\r\n");
    >> iRetVal = -1;
    >> }
    >> else
    >> {
    >> // Set the pixel format
    >> BOOL bResult = SetPixelFormat(m_pDC->m_hDC, nPixelFormat, &pfd);
    >> if ( bResult )
    >> {
    >> // Create a rendering context for OpenGL
    >> m_hRC = wglCreateContext(m_pDC->m_hDC);
    >> if (m_hRC == NULL)
    >> {
    >> TRACE("Unable to create a rendering context:
    >> %d\r\n",GetLastError());
    >> iRetVal = -1;
    >> }
    >> }
    >> else
    >> {
    >> TRACE("SetPixelFormat Failed %d\r\n",GetLastError());
    >> iRetVal = -1;
    >> }
    >> }
    >> }
    >> }
    >>
    >> return iRetVal;
    >> }
    >>

    >



    Well, you solved your problem by shiooting yourself in the foot. Now all
    your rendering is all-software, you have no access to extensions or shaders,
    and you can throw away your opengl hardware as you aren't using it.

    bad idea.

    jbw



  7. Default Re: Display problems in Vista


    "jbwest" <jbwest@comcast.net> wrote in message
    news:_LKdnc7rBcWwtZHanZ2dnUVZ_hGdnZ2d@comcast.com...
    >
    > "John A. Byerly" <jbyerly@essDASHquality.com> wrote in message
    > news:QGQOi.2517$ln.55@trnddc07...
    >> Hi,
    >>
    >> I was able to fix the problem by rendering to a DIB section and then
    >> BitBlt the rendered bitmap. This has actually solved a couple of
    >> problems we were experiencing.
    >>
    >> JAB

    >
    > Well, you solved your problem by shiooting yourself in the foot. Now all
    > your rendering is all-software, you have no access to extensions or
    > shaders, and you can throw away your opengl hardware as you aren't using
    > it.
    >
    > bad idea.


    How can you make such a statement? You don't know my requirements, other
    than it needs to work on Vista. I am not writing a graphics intensive
    application.

    JAB


  8. Default Re: Display problems in Vista

    John A. Byerly wrote:

    > How can you make such a statement? You don't know my
    > requirements, other
    > than it needs to work on Vista. I am not writing a graphics
    > intensive application.


    No, he's right. Doing so is really a bad idea. But at least it
    gives us a hint, what might be wrong.

    Did you even get a valid PIXELFORMATDESCRIPTOR? Without a proper
    PFD set, you won't even get an OpenGL context.

    Getting a PFD for a DIBSECTION almost never fails. And given the
    fact that Vista is quite picky about OpenGL I'd hunt for the bug
    there.

    Wolfgang Draxinger
    --
    E-Mail address works, Jabber: hexarith@jabber.org, ICQ: 134682867


  9. Default Re: Display problems in Vista


    "John A. Byerly" <jbyerly@essDASHquality.com> wrote in message
    news:fh9Pi.9166$C2.6625@trnddc02...
    >
    > "jbwest" <jbwest@comcast.net> wrote in message
    > news:_LKdnc7rBcWwtZHanZ2dnUVZ_hGdnZ2d@comcast.com...
    >>
    >> "John A. Byerly" <jbyerly@essDASHquality.com> wrote in message
    >> news:QGQOi.2517$ln.55@trnddc07...
    >>> Hi,
    >>>
    >>> I was able to fix the problem by rendering to a DIB section and then
    >>> BitBlt the rendered bitmap. This has actually solved a couple of
    >>> problems we were experiencing.
    >>>
    >>> JAB

    >>
    >> Well, you solved your problem by shiooting yourself in the foot. Now all
    >> your rendering is all-software, you have no access to extensions or
    >> shaders, and you can throw away your opengl hardware as you aren't using
    >> it.
    >>
    >> bad idea.

    >
    > How can you make such a statement? You don't know my requirements, other
    > than it needs to work on Vista. I am not writing a graphics intensive
    > application.
    >
    > JAB
    >


    Because even clearing the viewport is very expensive with software
    rendering, that's why.
    And you are on a non-extensible path. bad code is just plain bad code, IMO,
    whether it fits the purpose or not.

    jbw




  10. Default Re: Display problems in Vista

    "John A. Byerly" <jbyerly@essDASHquality.com> writes:
    > How can you make such a statement? You don't know my requirements,
    > other than it needs to work on Vista. I am not writing a graphics
    > intensive application.


    The thing is though, that the evidence seems to suggest there are
    problems with the way your program is using opengl. Switching to
    software rendering may hide them (for the time being) but they're still
    there, and could come back to bite you later.

    Maybe software rendering _is_ better for your task, but it would be much
    safer if you can figure out the problem first and make an informed
    decision, rather than crossing your fingers and hope everything's really
    OK.

    -Miles
    --
    `Suppose Korea goes to the World Cup final against Japan and wins,' Moon said.
    `All the past could be forgiven.' [NYT]

+ Reply to Thread
Page 1 of 5 1 2 3 ... LastLast

Similar Threads

  1. Re: Problems w/ Windows Vista?
    By Application Development in forum Adobe Photoshop
    Replies: 1
    Last Post: 12-06-2007, 12:34 PM
  2. display problems of vim
    By Application Development in forum Editors
    Replies: 1
    Last Post: 10-26-2007, 05:54 AM
  3. Still problems in Vista
    By Application Development in forum Adobe Photoshop
    Replies: 0
    Last Post: 09-24-2007, 11:01 AM
  4. IIS Problems in Vista
    By Application Development in forum DOTNET
    Replies: 10
    Last Post: 07-21-2007, 05:19 PM
  5. Which monitor should I get for Windows Vista to display HDTV?
    By Application Development in forum Hardware
    Replies: 1
    Last Post: 11-05-2006, 06:20 PM