Results 1 to 6 of 6

Thread: fullscreen switch error :(

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2003
    Location
    Chile
    Posts
    10

    fullscreen switch error :(

    I´ve been using nehes lesson06 as a base for my program...

    I changed this:
    glBegin(GLQUADS);
    blah
    blah
    blah
    blEnd();

    with something like this:
    glBegin(GL_TRIANGLES)
    for(i=0;i<12;i++)
    for(j=0;j<3;j++)
    glVertex3f(face[i].vert[j])

    Obviously this is not the real code (way to large), but the point is that works
    It draws the 3 vertices for each of the 12 faces.
    Everything is fine, the cube spins with the texture and all of that..

    The problem is when I hit F1 to swith to fullscreen (or if I started at Fullscreen, switching to window mode)

    Then I get the "Send Report" window, I debug it and i get and 00x000000005 Access Violation pointing to:
    glVertex3f(faces[i].vertex[j]);

    Really don´t know what can it be... I have not repeated the variables (i,j) in any other part of the program..
    and as I said it works great in both window mode and fullscreen, the problem shows up when I switch mode.

    Any ideas?
    Thanks
    ?

  2. #2
    Junior Member Newbie
    Join Date
    Jul 2003
    Location
    Townsville, QLD, Australia
    Posts
    23

    Re: fullscreen switch error :(

    certain opengl functions can't run (and have access violations or something similar) if no opengl context has been defined. i'm not sure what all these functions are (i know glGetString is one). When u switch screen modes, u have to destroy the window and the gl context, and recreate them. So maybe when you switch modes, you've forgotten to recreate the gl context.

    hope this helps
    --tristan

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

    Re: fullscreen switch error :(

    It's not just certain OpenGL functions that can't run before a context is created, it's all of them. Until you create a gl context none of the gl* functions will succeed.
    Deiussum
    Software Engineer and OpenGL enthusiast

  4. #4
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    23

    Re: fullscreen switch error :(

    This might be silly, but if that was the problem, then wouldnt glBegin send the error and not glVertex? Or possibly even a gl statement earlier?

  5. #5
    Junior Member Newbie
    Join Date
    Jul 2003
    Location
    Chile
    Posts
    10

    Re: fullscreen switch error :(

    Nah Don´t worry guys
    Thanks for the help
    But it seems that was some stupid error reading the values, I´m not sure what was it but I re-wrote the code for more objects and somehow the problem went away
    Thanksk anyway
    ?

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

    Re: fullscreen switch error :(

    Yeah, I didn't really read the original question that closely. Just wanted to clarify the bit about "certain" functions not working before a context is created. If I had actually looked at the original post like I should have, I would have said, "check your data. Make sure you aren't touching memory you have no right to touch."
    Deiussum
    Software Engineer and OpenGL enthusiast

Similar Threads

  1. Replies: 3
    Last Post: 02-20-2017, 12:54 PM
  2. Switch from fullscreen
    By ahmedfouad in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 06-05-2008, 02:41 PM
  3. Switch between fullscreen and small window
    By ahmedfouad in forum OpenGL ES
    Replies: 1
    Last Post: 06-01-2008, 02:56 AM
  4. Replies: 2
    Last Post: 03-18-2007, 02:24 PM
  5. AGL switch from fullscreen to windowed
    By binary in forum OpenGL: macOS
    Replies: 4
    Last Post: 02-02-2006, 01:35 AM

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