Skip to content

fullScreen(P2D) from an executable does not work properly #514

Closed
@processing-bot

Description

@processing-bot

Created by: UnintelligableGoofball

Description

For me, running a program with fullScreen() works fine from the IDE, but if I export it and run it from the .exe it doesn't cover the whole screen.

Expected Behavior

This is what the program is supposed to do, and what it indeed does do if run through the IDE.

Image

Current Behavior

However, if exported and run from the executable it displays as shown. It is not a window, and cannot be moved. It acts as though it were in fullscreen, and only closes when escape is pressed, but it does not cover the screen.

Image

Steps to Reproduce

1.Create a program that uses "fullScreen(P2D,1);" (you have to use P2D, otherwise it gets the pixel density wrong and makes everything low res, this is covered more in the Possible Causes)

2.Export the program in Presentation Mode

3.Run the resulting .exe file

This is the code which I had problems with, I have not tried any other programs but I am fairly sure the problem is from fullScreen(P2D,1):

//controlls the time between blinks (in milliseconds) NOTE: changing this will only change the time of the first blink, to change the rest change it on line 133
int blinkTime = 280;
// controls the position of the rectangles used as "eyelids"
int lowRect = -14;
int highRect = -117;
// used in blink() to keep track of weather the eyelids are supposed to be opening or closing
int blinkPhase = 0;
// controls how many pixels the "eyelids" move at a time, values above 25 could cause the "eyelids" to go through eachother.
int blinkTravel = 10;
// controls the size of the face
float scaleVal = 2;

void setup(){
  // boring well documented setup stuff
  noCursor();
  frameRate(40);
  fullScreen(P2D, 1);
  fill(0);

  // strokeWeight() at higher values convinently has rounded edges by default, so for the mouth we can just draw a line
  strokeWeight(15);
}

void draw(){
  // puts 0, 0 in the middle of the screen, keeps things centered with different sized screens
  translate(width/2, height/2);
  
  background(230, 115, 225);
  scale(scaleVal);
  fill(0);
  strokeWeight(15);
  stroke(0);
  
  //draws the face
  basic();
  // makes it blink every 300 milliseconds
  blink();
}

void basic() {
  // draws a basic, emotionless face
  line(-22, 40, 22, 40);
  circle(-75, -40, 35);
  circle(75, -40, 35);
}

void blink() {
  pushMatrix();
  noStroke();
  fill(230, 115, 225);
  
  rect(-125, lowRect, 250, 35);
  rect(-135, highRect, 250, 50);
  popMatrix();

  if(blinkTime < 1){
    if((lowRect >= -40) && (blinkPhase == 0)) {
      lowRect -= blinkTravel;
      highRect += blinkTravel;
    } else if (( lowRect <= -40) && ( blinkPhase == 0)) {
      blinkPhase = 1;
    } else if((lowRect <= -40) && (blinkPhase == 1)) {
      //delay(250);
      lowRect += blinkTravel;
      highRect -= blinkTravel;
    } else if ((lowRect < -14) && (lowRect > -40) && (blinkPhase == 1)) {
      lowRect += blinkTravel;
      highRect -= blinkTravel;
    } else if ((lowRect == -14) && (blinkPhase == 1)) {
      blinkPhase = 0;
      blinkTime = 300;
    }
  } else {
    blinkTime--;
  }
}

Your Environment

  • Processing version: 4.0b8
  • Operating System and OS version: Windows 11 version 21H2 (though I suspect you will have this issue on other windows 11 versions)
  • Other information: Monitor is 1080P

Possible Causes / Solutions

I suspect that this is related to another issue I ran into where if I did not specify P2D in fullScreen() and ran it from the excecutable it got the pixel density wrong and made everything really low resolution, but at least that covered the whole screen. (Some digging on forums lead me to including P2D.) My theory is that if before I included P2D it was low res, but basically stretched to cover the whole monitor, then now that it accurately knows the pixel density it might be the same size image, just shrunk down to the right pixel density.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions