| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
According to the docs, aglGetInteger(context,AGL_FULLSCREEN,params) is
supposed to return 3 parameters: the width, height, and refresh rate of the
current context. (As long as "context" is a fullscreen context.)
This does not seem to be working for me. It is not modifying the values of
any of the params array. (I thought it was returning garbage until I zeroed
out the params array before the aglGetInteger call - then I realized they
were simply not being modified. Below I set them to -1 initially to prove
that they are unchanged, rather than being zeroed by the aglGetInteger
call.)
Here is some sample code:
// More includes might be needed to compile, I am not sure what else my
// code is including earlier that I used.
#include "gl.h"
#include "agl.h"
#include <iostream>
namespace {
GLint attrib[] = { AGL_RGBA, AGL_ACCELERATED,
AGL_DOUBLEBUFFER, AGL_FULLSCREEN, AGL_NONE };
GLint stereoAttrib[] = { AGL_RGBA, AGL_ACCELERATED,
AGL_STEREO, AGL_DOUBLEBUFFER,
AGL_FULLSCREEN, AGL_NONE };
}
void DoTest (GLint* theAttrib);
void DoMyQuickAndDirtyTest ()
{
std::cout << "Testing fullscreen mono" << std::endl;
DoTest(attrib);
std::cout << "End testing fullscreen mono" << std::endl << std::endl;
std::cout << "Testing fullscreen stereo" << std::endl;
DoTest(stereoAttrib);
std::cout << "End testing fullscreen stereo" << std::endl;
}
void DoTest (GLint* theAttrib)
{
GDHandle device=::GetMainDevice();
AGLPixelFormat format=::aglChoosePixelFormat(&device,1,theAttrib);
if (format)
{
std::cout << "Created format successfully" << std::endl;
AGLContext context=::aglCreateContext(format,NULL);
::aglDestroyPixelFormat(format);
if (context)
{
std::cout << "Created context successfully" << std::endl;
if (!::aglSetFullScreen(context,1024,768,120,0))
{
std::cout << "aglSetFullScreen returned error " <<
::glGetError() << std::endl;
}
else
{
std::cout << "aglSetFullScreen succeeded" << std::endl;
// I experimented with putting this ::aglEnable call several
// places, as well as leaving it out - my results were
// always the same.
::aglEnable(context,AGL_FULLSCREEN);
GLint params[3];
params[0]=params[1]=params[2]=-1;
if (!::aglGetInteger(context,AGL_FULLSCREEN,params))
{
std::cout << "aglGetInteger returned error " <<
::glGetError() << std::endl;
}
else
{
std::cout << "aglGetInteger succeeded" << std::endl;
std::cout << "Result: { " << params[0] << ", "
<< params[1] << ", "
<< params[2] << "}" << std::endl;
}
}
::aglDestroyContext(context);
} }
}
// -------------------------- End code snippet
I am calling DoMyQuickAndDirtyTest () at the beginning of my main function,
just to duplicate the problem. Here's what it outputs:
Testing fullscreen mono
Created format successfully
Created context successfully
aglSetFullScreen succeeded
aglGetInteger succeeded
Result: { -1, -1, -1}
End testing fullscreen mono
Testing fullscreen stereo
Created format successfully
Created context successfully
aglSetFullScreen succeeded
aglGetInteger succeeded
Result: { -1, -1, -1}
End testing fullscreen stereo
The contexts are getting created and everything and they *are* fullscreen,
and they are the desired size and refresh rate - obviously it'd be tough to
tell this in my test code above, but in the actual code that is trying to
use ::aglGetInteger, it does enough that I can tell that it is creating a
stereo context 1024x768x120 Hz, successfully and drawing to it successfully.
Everything works except checking the size and stuff as demonstrated above.
The above test was with a Mach-O project on 10.2.3, but I have seen the same
behavior with a CFM based project, and on 10.2.2.
So now, the question is, should the above code be generating "Result: {
1024, 768, 120 }" instead of leaving the contents of params unchanged? Am I
doing something wrong, or do I need to file a bug report?
Thought I'd run this one by the list to see if you guys can spot my usage
mistake, if I made one.
Also, this is with a Radeon card, I believe it is a Radeon 7000. (it is
some 7xxx number.)
I left out the extra debugging stuff the debugger outputs in the above
output, the =shlibs-added/updated/etc stuff. If anyone needs to see that to
help, I can post the full output. I just thought I'd excise that stuff to
make the output above easily readable.
This is incredibly frustrating, since this should be something very simple
and the documentation on how to use this call to get this information is
very straightforward.
-- Bobby
---------------------------------------------------------------------
Bobby Thomale
Senior Software Developer
Inoveon Corporation
http://www.inoveon.com/
---------------------------------------------------------------------
_______________________________________________
mac-opengl mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/mac-opengl
Do not post admin requests to the list. They will be ignored.
| References: | |
| >[BUG?] ::aglGetInteger fails with AGL_FULLSCREEN (From: Bobby Thomale <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.