graphics

OpenGL Driver Monitor says textures are rapidly increasing. How to find the leak?

烈酒焚心 提交于 2020-01-24 09:31:12
问题 When I run my app, OpenGL Driver Monitor says the Textures count is rapidly increasing — within 30 seconds the Textures count increases by about 45,000. But I haven't been able to find the leak. I've instrumented every glGen*() call to print out every GL object name it returns — but they're all less than 50, so apparently GL objects created by glGen*() aren't being leaked. It's a large, complex app that renders multiple shaders to multiple FBOs on shared contexts on separate threads, so

OpenGL: Set position instead of translating?

走远了吗. 提交于 2020-01-24 05:45:06
问题 Can I set the current render position to be an arbitrary value, instead of just giving it an offset from the current location? This is what I'm doing currently: gl.glTranslatef(3.0f, 0.0f, 2.0f); It allows me to say "I want to move left" but not "I want to move to point (2, 1, 2)". Is there a way to do the latter? I'm using OpenGL with JOGL. Update : @Bahbar suggests the following: gl.glLoadIdentity(); gl.glTranslatef(...); When I do this, everything except six lines disappears. I'm not sure

Obtaining the Width in Pixels of any given character

一笑奈何 提交于 2020-01-24 02:59:06
问题 I have this really awesome idea, but cannot find out if there are any classes in the .NET Framework (any version, preferrably 3.5 or 4.0) that allow you to pass in a character, and get back the width in pixels of that character, no matter which font, or font size or font-decoration is being used. Can someone please point me in the right direction? Does a class/something even exist for something like this? 回答1: Check out the Graphics.MeasureString method. Code sample adapted from the link:

How to use 3d texture in opengl and cg shaders?

*爱你&永不变心* 提交于 2020-01-24 01:32:04
问题 I've got a problem with 3d texture mapping. If I have several 2d textures, and I want to build a 3d texture with these 2d textures. What can I do to put all these data together? The function glTexImage3D ends with a parameter const GLvoid *texels which leads to the data of the texture. But now I have 32 2D textures and want to get a 3D texture. How to do that? The second question is about image space filtering method. Is there anyone who knows what it is? I should use this method to determine

Double x axis (analog to doubleYScale) with lattice extra or similar

泄露秘密 提交于 2020-01-23 09:29:38
问题 I want to make specific figures that we need in oceanography. Unfortunately double, triple or more axes are not very good implemented in R. I don't need a double y axis as in doubleYScale of lattice extra. I need double or triple x axis. I could not find a way to use doubleYScale to my advantage. Maybe that's possible. Help would be appreciated a lot. This is what I have now based on the data: stackoverflow_fluo.csv: http://pastebin.com/embed_js.php?i=7KNEiytF animals_stackoverflow.csv:http:/

Double x axis (analog to doubleYScale) with lattice extra or similar

最后都变了- 提交于 2020-01-23 09:29:08
问题 I want to make specific figures that we need in oceanography. Unfortunately double, triple or more axes are not very good implemented in R. I don't need a double y axis as in doubleYScale of lattice extra. I need double or triple x axis. I could not find a way to use doubleYScale to my advantage. Maybe that's possible. Help would be appreciated a lot. This is what I have now based on the data: stackoverflow_fluo.csv: http://pastebin.com/embed_js.php?i=7KNEiytF animals_stackoverflow.csv:http:/

Swift 3: Drawing a rectangle

回眸只為那壹抹淺笑 提交于 2020-01-23 05:04:05
问题 I'm 3 days new to swift, and I'm trying to figure out how to draw a rectangle. I'm too new to the language to know the classes to extend and the methods to override, and I've looked around for sample code, but nothing seems to work (which I'm attributing to my use of swift 3). What I'm trying now is: import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let k = Draw(frame: CGRect( origin: CGPoint(x: 50, y: 50), size: CGSize(width: 100, height:

Swift 3: Drawing a rectangle

泄露秘密 提交于 2020-01-23 05:02:58
问题 I'm 3 days new to swift, and I'm trying to figure out how to draw a rectangle. I'm too new to the language to know the classes to extend and the methods to override, and I've looked around for sample code, but nothing seems to work (which I'm attributing to my use of swift 3). What I'm trying now is: import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let k = Draw(frame: CGRect( origin: CGPoint(x: 50, y: 50), size: CGSize(width: 100, height:

Mode X in Assembly x86-16, Why plane 1 is not printing and all the other planes are not in the correct order?

我与影子孤独终老i 提交于 2020-01-23 00:35:45
问题 I am writing in TASM 3.0 on DosBox 0.74 and I am trying to write in Mode x (Tweaked 13h, unchained mode 13), but how you can see on the image, it's not creating the quite right. It seems that plane 1 (second plane) is not printing at all, and all the others are not in the right order. I know that the code that I will show you is slow and is not productive, but I want to make it work then clean up the code. proc showBMP push cx mov ax, 0A000h mov es, ax mov cx, [BMPHeight] mov ax, [BMPWidth]

Mode X in Assembly x86-16, Why plane 1 is not printing and all the other planes are not in the correct order?

本小妞迷上赌 提交于 2020-01-23 00:35:09
问题 I am writing in TASM 3.0 on DosBox 0.74 and I am trying to write in Mode x (Tweaked 13h, unchained mode 13), but how you can see on the image, it's not creating the quite right. It seems that plane 1 (second plane) is not printing at all, and all the others are not in the right order. I know that the code that I will show you is slow and is not productive, but I want to make it work then clean up the code. proc showBMP push cx mov ax, 0A000h mov es, ax mov cx, [BMPHeight] mov ax, [BMPWidth]