5

Lesson of the Day

 3 years ago
source link: https://www.mikeash.com/pyblog/lesson-of-the-day.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Lesson of the Day
mikeash.com: just this guy, you know?
Lesson of the Day
by Mike Ash  

OpenGL contexts have maximum viewport sizes. If you attempt to exceed the maximum size by, say, calling glViewport() with a size greater than that, you'll get incomplete drawing and weird corruption. This is particularly bad if you're using OpenGL as an interface element in a resizable window. To fix it, call glGetIntegerv(GL_MAX_VIEWPORT_DIMS, dims) to get the max viewport size, then limit your window's size to make sure you never exceed it.

This is probably obvious to some people, but I only just discovered it today and fixed a bug that's been in the affected (as-yet-unshipped) app for months.

That is all.

No comments:

Did you enjoy this article? I'm selling whole books full of them! Volumes II and III are now out! They're available as ePub, PDF, print, and on iBooks and Kindle. Click here for more information.

No comments have been posted.

Comments RSS feed for this page

Add your thoughts, post a comment:

Spam and off-topic posts will be deleted without notice. Culprits may be publicly humiliated at my sole discretion.

Name:Web site:The Answer to the Ultimate Question of Life, the Universe, and Everything?Comment:Formatting: <i> <b> <blockquote> <code>. URLs are automatically hyperlinked.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK