It's good. You should be free to do this, since isolating variables are good practice. You can read these locked blocks as idiosyncratic anonymous functions in place, which is sometimes useful to keep the code visually grouped together, although, of course, every time you do this, you should ask yourself: "Should I really to make this a separate function? "as suggested by other posts here.
Another useful thing that can be achieved, especially if you are using a code editor that automatically formats blocks, is indentation of important and special sections of the code that would not otherwise indent. eg:.
glBegin(GL_TRIANGLES); { glVertex3f( 0.0f, 1.0f, 0.0f); glVertex3f(-1.0f,-1.0f, 0.0f); glVertex3f( 1.0f,-1.0f, 0.0f); }; glEnd();
source share