Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P2b9 : PImage scaling not working on retina MBP #1812

Closed
robotconscience opened this issue May 23, 2013 · 8 comments
Closed

P2b9 : PImage scaling not working on retina MBP #1812

robotconscience opened this issue May 23, 2013 · 8 comments
Assignees

Comments

@robotconscience
Copy link

Steps to reproduce:

  • make a 1024x768 window
  • load a 200x200 image
  • draw image w/ image(myImage, 0, 0, width, height);

Expected behavior:

  • Image scales to screen

What happens:

  • Image draws at its actual size anchored to bottom right of screen

Works like a charm on non-retina Macbook Pro!

@datguy
Copy link
Contributor

datguy commented May 24, 2013

Can you provide any more detail? I tried to reproduce it with the following sketch and the attached image, and it worked as expected.

size(1024,768);
PImage img = loadImage("image.jpg");
image(img,0,0,width,height);

image

@robotconscience
Copy link
Author

Sorry, just looked at my post and I misspoke! It was actually specific to a PGraphics object. I (mistakenly) assumed the bug would be with PImages as well.

@REAS
Copy link
Member

REAS commented May 25, 2013

@robotconscience Please post a simple, short example that shows the problem so we can test it easily.

@robotconscience
Copy link
Author

Sure! After digging into the code a bit (my error was specifically with using the Syphon lib) the bug is much more specific. A texture drawn to a PGraphics object via PGraphicsOpenGL does not scale, although the rest of the PGraphics seems to. It's very specific, but pops up immediately with the Syphon library (and behaves as expected on non Retina Macbooks). Hope this helps!

PGraphics dest;
PImage img;

void setup()
{
  size(800, 600, OPENGL);
  img = loadImage("test.jpeg");
  image(img,0,0);
  dest = createGraphics(img.width, img.height, PConstants.P2D);

  println(img.width +":"+ img.height);

  PGraphicsOpenGL destpg = (PGraphicsOpenGL)dest;

  destpg.beginDraw();
  Texture tex = destpg.getTexture(img);
  destpg.background(255,0,0);
  destpg.drawTexture(tex.glTarget, tex.glName, tex.glWidth, tex.glHeight, 
                     0, 0, tex.glWidth, tex.glHeight);
  destpg.endDraw();
}

void draw() {
  image( dest, 0,0,width, height);
}

@ghost ghost assigned codeanticode May 28, 2013
@codeanticode
Copy link
Member

Hi-Dpi Mode is not supported yet by the underlying opengl-java bindings (JOGL in the default OpenGL renderer):

http://forum.jogamp.org/Retina-support-in-OSX-td4029248.html#a4029251

so this might have something to do with this issue (and possibly with #1699 as well), however if that's the case the solution depends on JOGL adding support for Retina.

@benfry
Copy link
Contributor

benfry commented May 30, 2013

There is also no "Texture" API supported in Processing. No getTexture(), drawTexture(), etc. You're filing bugs against undocumented features that are not supported.

@benfry benfry closed this as completed May 30, 2013
@robotconscience
Copy link
Author

Ok! No problem; it looks like it'd be better to submit it against Syphon, then. Thanks!

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants