Jump to content
  • Advertisement
Sign in to follow this  
rick_appleton

OpenGL OpenGL + .NET: Resizing

This topic is 3740 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been able to link a C# app, to a managed wrapper lib with a C++ dll to run OpenGL code in a nice frontend (for an editor). I'm only having a problem with the resizing of the window. The sample code I found captures the ResizeEnd event, and correctly passes this through to the OpenGL wrapper. However, I need to capture the Resize event also and properly handle that, else if you make the window larger, the program crashes (presumably because the OpenGL backbuffer is temporarily smaller than the view of it. Does anyone know how I can fix this? In the ResizeEnd event the following code is used to give the width and height of my panel (the original source code was taken from here
HRESULT COpenGLManager::ResizeTo( int width, int height )
{
	m_uiWidth = width;
	m_uiHeight = height;

	SetBBDim(m_uiWidth,m_uiHeight);

	return Reset();
}

HRESULT COpenGLManager::Resize()
{
	RECT rcWindowClient;
	GetClientRect(m_hDevWindow, &rcWindowClient);

	return ResizeTo(rcWindowClient.right - rcWindowClient.left, rcWindowClient.bottom - rcWindowClient.top);
}

Share this post


Link to post
Share on other sites
Advertisement
Bump, and a partial request for the mods to maybe move this thread? I wasn't sure where to put it so decided on OpenGL first of all, but it might get more answers in the General Programming forum.

Share this post


Link to post
Share on other sites
Quote:
Original post by iliak
If you need to use OpenGL with your .Net projects, have a look at Tao Framework.


The thing is that I have a fairly large C++ codebase which I use for my projects, and I want to link into the renderer in there.

Share this post


Link to post
Share on other sites
The program shouldn't actually crash because the backbuffer is smaller - so maybe it's a driver issue or a problem with the wrapper. Without more code (how does the wrapper react to window resize events?), it's almost impossible to debug this.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!