problem with fullscreen

  • Neamow

    Neamow - 2012-08-12

    Hi, I'm just starting with Andorra, and going through the second tutorial (Part 2 - The first graphic), I found that the code for enabling fullscreen doesn't work.

    All of the four lines inside begin and end in

    with AdDraw.Display do
        Width := 800;
        Height := 600;
        BitDepth := ad32Bit;
        DisplayMode := dmFullscreen;
    will send an error: Left side cannot be assigned to.
    Can anyone help me? What am I doing wrong?
  • Neamow

    Neamow - 2012-08-12

    hm, forgot to close the code section…

    nevermind, any ideas?

  • Ndi

    Ndi - 2013-02-11

    If you work in D 2010, then the Display property in Andorra is read-only and, as a result, members are passed over as a copy. Which you probably don't care about :)

    Do this:

    Go to AdDraw.pas (or ctrl+click Display property) and you will see a line like this:

        property Display: TAdDisplay read FDisplay;

    This is the declaration of a read-only propery and is the cause of you troubles. The easiest to do it is to set fDisplay ourselves. After all Display is just for beauty (and some protection). So go up and find the actual variable:

    FDisplay: TAdDisplay;

    It is in the "private" section. Move it to the "public" section:

      FDisplay: TAdDisplay;

    Best comment the line in Private and copy a new one in Public so it's easy to come back and undo it.

    Now fDisplay is accessible from anywhere. Save the unit and go back to your program. Instead of using Display to set parameters, use fDisplay which is now not read only any longer.

    with A.FDisplay do
          Width := 1920;
          Height := 1080;
          BitDepth := ad32Bit;
          DisplayMode := dmFullscreen;


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks