OpenGL display size.
Moderators: CEGUI MVP, CEGUI Team
OpenGL display size.
Hello guys, I realized after integrating CEGUI to my engine that I can't use fullscreen mode, when I try to use fullscreen happens this: https://gyazo.com/d8b13ab160d1beec1d82730443a9c73a and this is the normal aspect https://gyazo.com/ccaae785f7db9ee882aa68705a613a1b how can I update the CEGUI OpenGL renderer to new size? I tried with codes but I can't find the correct function. Thanks in advance.
Re: OpenGL display size.
Well, from looking at how the CEGUI sample framework does it, this seems to be the way:
Perhaps u also need to call "glViewport" with the new size, I dunno.
Code: Select all
CEGUI::System::getSingleton().
notifyDisplaySizeChanged(
CEGUI::Sizef(newWindowWidth, newWindowHeight)));
Perhaps u also need to call "glViewport" with the new size, I dunno.
Re: OpenGL display size.
It crashes when I press Fullscreen toggle key:
Crash details:
Code: Select all
GUI.Initialized = false; ///DISABLE GUI RENDERING WHILE CHANGING SCREEN SIZE
glutReshapeWindow(1920, 1080);
GL.Perspective(1920, 1080);
CEGUI::System::getSingleton().notifyDisplaySizeChanged(CEGUI::Sizef(1920, 1080));
glutFullScreen();
GUI.Initialized = true; ///ENABLE GUI RENDERING
Crash details:
Code: Select all
First-chance exception at 0x693B8C36 (nvoglv32.dll) in Classic Engine.exe: 0xC0000005: Access violation reading location 0x000016BC.
Code: Select all
> nvoglv32.dll!693b8c36() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for nvoglv32.dll]
CEGUIBase-0.dll!77cde2e6() Unknown
CEGUIBase-0.dll!77ca26b1() Unknown
CEGUIBase-0.dll!77ca62ee() Unknown
CEGUIBase-0.dll!77d12f9e() Unknown
CEGUIBase-0.dll!77ca6142() Unknown
CEGUIBase-0.dll!77dbbea0() Unknown
CEGUIBase-0.dll!77dcee1c() Unknown
CEGUIBase-0.dll!77d105b4() Unknown
CEGUIBase-0.dll!77d115f9() Unknown
CEGUIBase-0.dll!77d125f7() Unknown
CEGUIBase-0.dll!77dbbd92() Unknown
CEGUIBase-0.dll!77dce619() Unknown
CEGUIBase-0.dll!77d203f8() Unknown
CEGUIBase-0.dll!77d0f690() Unknown
CEGUIBase-0.dll!77ca91e2() Unknown
CEGUIBase-0.dll!77caa814() Unknown
CEGUIBase-0.dll!77cb8f5e() Unknown
CEGUIBase-0.dll!77caa7cf() Unknown
CEGUIBase-0.dll!77cb0269() Unknown
CEGUIBase-0.dll!77cb0211() Unknown
CEGUIBase-0.dll!77cb19d1() Unknown
CEGUIBase-0.dll!77cfcc0b() Unknown
[External Code]
Re: OpenGL display size.
There's no need to disable gui rendering. You can do it on-the-fly:
https://bitbucket.org/lucebac/cegui/src ... L2.cpp-285
EDIT: wrong link
https://bitbucket.org/lucebac/cegui/src ... L2.cpp-285
EDIT: wrong link
Re: OpenGL display size.
Tonyx97: The backtrace would be more helpful with file names and lines and functions names in it. Perhaps you've built cegui in "Release" configuration rather then "Debug"?
Re: OpenGL display size.
Yes I'm using Release but is there only way to get my engine works... When I compile my project as Debug it crashes when the GLUT Windows opens. The exception it throws is
And the callstack:
I already tried to fix this crash but I didn't success.
Code: Select all
First-chance exception at 0x76F4C42D in Classic Engine.exe: Microsoft C++ exception: std::length_error at memory location 0x0018DFBC.
And the callstack:
Code: Select all
KernelBase.dll!_RaiseException@16() Unknown
[External Code]
CEGUIBase-0.dll!5f40c24d() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for CEGUIBase-0.dll]
CEGUIBase-0.dll!5f34ee87() Unknown
CEGUIBase-0.dll!5f347159() Unknown
> Classic Engine.exe!ToString(float value, std::basic_string<char,std::char_traits<char>,std::allocator<char> > type) Line 11 C++
Classic Engine.exe!Label::CLabel(CEGUI::String text, float x, float y, float sx, float sy, Color color, CEGUI::String font, CEGUI::String horzAlign, CEGUI::String vertAlign, CEGUI::Window * parent) Line 127 C++
Classic Engine.exe!InitGUI() Line 43 C++
Classic Engine.exe!initGL() Line 213 C++
Classic Engine.exe!main(int argc, char * * argv) Line 78 C++
[External Code]
I already tried to fix this crash but I didn't success.
Re: OpenGL display size.
Why are the symbols not loaded in your Debug build? You should fix this and post a proper callstack.
CrazyEddie: "I don't like GUIs"
Re: OpenGL display size.
I think I loaded all symbols but I'm still getting errors with the crash.
And there is another interesting thing I found 1 dll is not loading and it's this: Maybe is this the main problem? I don't know where to find pdb file for this file and it's not generated by VS.
Code: Select all
KernelBase.dll!_RaiseException@16() Unknown
[External Code]
> CEGUIBase-0.dll!CEGUI::String::grow(unsigned int new_size) Line 63 C++
CEGUIBase-0.dll!CEGUI::String::assign(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & std_str, unsigned int str_idx, unsigned int str_num) Line 1352 C++
CEGUIBase-0.dll!CEGUI::String::String(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & std_str) Line 418 C++
Test.exe!ToString(float value, std::basic_string<char,std::char_traits<char>,std::allocator<char> > type) Line 11 C++
Test.exe!Label::CLabel(CEGUI::String text, float x, float y, float sx, float sy, Color color, CEGUI::String font, CEGUI::String horzAlign, CEGUI::String vertAlign, CEGUI::Window * parent) Line 127 C++
Test.exe!InitGUI() Line 43 C++
Test.exe!initGL() Line 213 C++
Test.exe!main(int argc, char * * argv) Line 78 C++
[External Code]
Code: Select all
Unhandled exception at 0x76F4C42D in Test.exe: Microsoft C++ exception: std::length_error at memory location 0x0095D83C.
And there is another interesting thing I found 1 dll is not loading and it's this:
Code: Select all
nvoglv32.dll C:\Windows\SysWOW64\nvoglv32.dll N/A Yes Cannot find or open the PDB file. 53 10.18.13.5560 07/08/2015 5:14 689C0000-69B91000 [6984] Test.exe
Re: OpenGL display size.
You cannot find PDB files for any nv*.dll files since these are NVIDIA's graphic driver files.
Re: OpenGL display size.
Tony, look up what a pdb file is before making assertions please. We are not a C++ teaching forum so don't ask us general C++ or static/dynamic linkage related questions. Maybe someone else has the time to help you with this but the CEGUI developer team definitely does not have the resources for that, sorry.
The information you get now is quite clear. In the grow function an length related exception is thrown. Would you mind to post the exact argument you send to CEGUI::String::String from Test.exe!ToString(...) before the exception is thrown? Use the callstack to retrieve what was passed in each step. This should make it quite obvious what happened. Post all the info here.
We probably can continue from there on.
The information you get now is quite clear. In the grow function an length related exception is thrown. Would you mind to post the exact argument you send to CEGUI::String::String from Test.exe!ToString(...) before the exception is thrown? Use the callstack to retrieve what was passed in each step. This should make it quite obvious what happened. Post all the info here.
We probably can continue from there on.
CrazyEddie: "I don't like GUIs"
Re: OpenGL display size.
There are 2 function which maybe you want to check it out:
When I call them is when I create 1 new GUI element like this:
As you can see in the first line I use ToString to convert a int into string, if you check the ToString function you'll know why I use the second argument. TWindows it's a int which increases everytime I create new WINDOW. In case of ToHex, there is a example:
Code: Select all
CEGUI::String ToString(float value, string type)
{
if (type == "float") return to_string(value);
else if (type == "int") return to_string((int)value);
}
CEGUI::String ToHex(int value)
{
ostringstream stream;
stream << std::hex << value;
if (value < 16) return "0" + stream.str();
return stream.str();
}
When I call them is when I create 1 new GUI element like this:
Code: Select all
CEGUI::Window* GUI_t::CWindow(CEGUI::String text, float x, float y, float sx, float sy, Color color, CEGUI::String font, CEGUI::Window* parent /* NULL = Root*/)
{
CEGUI::Window* window = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/FrameWindow", "Window_" + ToString(TWindows, "int") + "");
if (parent != NULL)
{
parent->addChild(window);
window->setPosition(CEGUI::UVector2(CEGUI::UDim(x / (parent->getSize().d_width.d_scale * 1300), 0.0f), CEGUI::UDim(y / (parent->getSize().d_height.d_scale * 900), 0.0f)));
window->setSize(CEGUI::USize(CEGUI::UDim(sx / (parent->getSize().d_width.d_scale * 1300), 0.0f), CEGUI::UDim(sy / (parent->getSize().d_height.d_scale * 900), 0.0f)));
}
else
{
Root->addChild(window);
window->setPosition(CEGUI::UVector2(CEGUI::UDim(x / 1300, 0.0f), CEGUI::UDim(y / 900, 0.0f)));
window->setSize(CEGUI::USize(CEGUI::UDim(sx / 1300, 0.0f), CEGUI::UDim(sy / 900, 0.0f)));
}
window->setText(text);
window->setFont(font);
Windows[TWindows] = window;
TWindows++;
return window;
}
As you can see in the first line I use ToString to convert a int into string, if you check the ToString function you'll know why I use the second argument. TWindows it's a int which increases everytime I create new WINDOW. In case of ToHex, there is a example:
Code: Select all
button->setProperty("NormalTextColour", ToHex(color.a) + ToHex(color.r) + ToHex(color.g) + ToHex(color.b)); ///ARGB
Re: OpenGL display size.
Tony, I didn't ask why you do things the way you do them, I asked what the value that is passed actually is in the case of the exception so we can determine the cause of the problem. Use the debugger and the callstack to find out what value causes the issue and tell us. It should not be difficult if you have worked with Visual Studio before.
CrazyEddie: "I don't like GUIs"
Re: OpenGL display size.
I don't use to check callstacks and similar debug stuff. The value is passed it's 0. I've fixed ToString function, now the problem is on ToHex:
I pass the value 255 which is "ff" in hex, when the function try to return "ff" it crashes.
Code: Select all
CEGUI::String ToHex(int value)
{
if (value == 0) return "FAIL";
ostringstream stream;
stream << std::hex << value;
if (value < 16) return "0" + stream.str();
cout << "hex: " << stream.str() << endl;
return stream.str();
}
I pass the value 255 which is "ff" in hex, when the function try to return "ff" it crashes.
Re: OpenGL display size.
Tony: I don't c why the function should crash, and indeed when I try to call it with "255" it doesn't crash. I'm on Linux, though.
Re: OpenGL display size.
I dont know why you go all the way out of your way to conver to hex from float, if you can simply construct a CEGUI::Colour based on the float r,g,b and a value and convert it to String using PropertyHelper as done everywhere in CEGUI code and the samples.
Regarding your code: I still cannot tell what problem there is based on the information given.
You say "now the problem is on ToHex:" but you don't specify. I am losing interest in helping, you are making this a huge struggle
Regarding your code: I still cannot tell what problem there is based on the information given.
You say "now the problem is on ToHex:" but you don't specify. I am losing interest in helping, you are making this a huge struggle

CrazyEddie: "I don't like GUIs"
Who is online
Users browsing this forum: No registered users and 16 guests