Results 1 to 10 of 10

Thread: After installing GeForce 4mx my programs ceased to work

  1. #1
    Guest

    After installing GeForce 4mx my programs ceased to work

    When I call ChoosePixelFormat function, compilation ends abruptly. Maybe someone has already encountered this problem?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: After installing GeForce 4mx my programs ceased to work

    The compilation usualy ends on a syntax error. Post the code that generates the error, including the error message itself.

    ChoosePixelFormat is a Win32 API function and does not change because you change graphics card. The behaviour of it may, but thats a run time problem, not a compile time.

  3. #3
    Guest

    Re: After installing GeForce 4mx my programs ceased to work

    It ends without any warnings or error messages. The code is form OpenGL12.pas header file:

    FillChar(PFDescriptor, SizeOf(PFDescriptor), 0);
    with PFDescriptor do
    begin
    nSize := SizeOf(PFDescriptor);
    nVersion := 1;
    dwFlags := PFD_SUPPORT_OPENGL;
    AType := GetObjectType(DC);
    if AType = 0 then
    RaiseLastOSError;

    if AType in MemoryDCs then
    dwFlags := dwFlags or PFD_DRAW_TO_BITMAP
    else
    dwFlags := dwFlags or PFD_DRAW_TO_WINDOW;
    if opDoubleBuffered in Options then
    dwFlags := dwFlags or PFD_DOUBLEBUFFER;
    if opGDI in Options then
    dwFlags := dwFlags or PFD_SUPPORT_GDI;
    if opStereo in Options then
    dwFlags := dwFlags or PFD_STEREO;
    iPixelType := PFD_TYPE_RGBA;
    cColorBits := ColorBits;
    cDepthBits := 32;
    cStencilBits := StencilBits;
    cAccumBits := AccumBits;
    cAuxBuffers := AuxBuffers;
    if Layer = 0 then
    iLayerType := PFD_MAIN_PLANE
    else
    if Layer > 0 then
    iLayerType := PFD_OVERLAY_PLANE
    else
    iLayerType := Byte(PFD_UNDERLAY_PLANE);
    end;
    if not InitOpenGL then
    RaiseLastOSError;
    PixelFormat := ChoosePixelFormat(DC, @PFDescriptor); // that's where it ends
    if PixelFormat = 0 then
    RaiseLastOSError;

    if GetPixelFormat(DC) <> PixelFormat then
    begin
    if not SetPixelFormat(DC, PixelFormat, @PFDescriptor) then
    RaiseLastOSError;
    end;

    DescribePixelFormat(DC, PixelFormat, SizeOf(PFDescriptor), PFDescriptor);
    with PFDescriptor do
    if (dwFlags and PFD_NEED_PALETTE) <> 0 then
    Palette := SetupPalette(DC, PFDescriptor)
    else
    Palette := 0;

    Result := wglCreateLayerContext(DC, Layer);
    if Result = 0 then
    RaiseLastOSError
    else
    LastPixelFormat := 0;
    end;

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: After installing GeForce 4mx my programs ceased to work

    Haven't done any Pascal in quite a few years, so can't help much there. To me it seems pretty strange the compiler just stops without reporting why it stopped.

    As long as @ means "address of", or something similar, then I see no error in your code.

    By the way, if the compiler doesn't say anything, how can you know that's the line where the compilation ends?

  5. #5
    Guest

    Re: After installing GeForce 4mx my programs ceased to work

    I trace it step-by-step

  6. #6
    Guest

    Re: After installing GeForce 4mx my programs ceased to work

    Yes, "@" is address. Thanks anyway

  7. #7
    Super Moderator OpenGL Guru imported_dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,966

    Re: After installing GeForce 4mx my programs ceased to work

    It won't be ending in there, it'll be returning zero. You are trying to choose a pixel format that is unsupported, for example too many bits of z + destination alpha + stencil. Try no overlay etc.

    Try setting cDepthBits to 1 (this says give me the biggest supported depth buffer) and perhaps do the same with stencil. When chosing a pixel format descriptor you MUST have fallback options so you can reduce the requirements should you fail to get what you ask for, what happens when the hardware doesn't support what you ask for? Well you found out I suppose.

    A better way is to enummerate the pixel formats and choose one which suits you. That way you're less likely to fail.


    [This message has been edited by dorbie (edited 07-03-2002).]

  8. #8
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: After installing GeForce 4mx my programs ceased to work

    If you can't compile the program, then how can you trace it step by step? To be able to trace it at all, you must be able to compile it so you can run it.

    Are you sure don't mean it's a RUN TIME problem, and not a compile time? Cause if you can trace it, you sure must be able to compile it properly.

  9. #9
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: After installing GeForce 4mx my programs ceased to work

    I agree with Bob that you probably mean a runtime error rather than a compile error. It's been awhile since I've worked with Pascal, but so far as I recall, it isn't an interpreted language, so it needs to be compiled before it can be run. Maybe I'm wrong about that, though.
    Deiussum
    Software Engineer and OpenGL enthusiast

  10. #10
    Guest

    Re: After installing GeForce 4mx my programs ceased to work

    Probably you're right, I'm able to trace it,so it's a runtime problem. I'll try what you advised.

Similar Threads

  1. Can't get FBO to work on GeForce 7400m
    By imported_jwatte in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 08-05-2008, 10:39 AM
  2. msi geforce fx5200, major slowdown using fragment programs
    By jcabeleira in forum OpenGL: Advanced Coding
    Replies: 23
    Last Post: 09-02-2003, 12:15 PM
  3. does the geforce 4 support fragment programs?
    By jcabeleira in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 08-18-2003, 10:55 AM
  4. Finally!!! Got Open GL to work with GeForce
    By thewoody in forum OpenGL: User Software
    Replies: 1
    Last Post: 05-12-2001, 08:42 PM
  5. OpenGL SuperBible sample programs don't work.
    By Scarab_Wes in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 03-19-2001, 01:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean