×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2003
    Location
    Ukraine
    Posts
    75

    Fullscreen output trouble on 6630

    I try to render 3d scene.
    Scene rendering with some trouble. It render only on the top part of screen but bottom is empty.
    There is a code of rendering
    public static final void draw3d() {
    boolean bound = false;
    try
    {
    try {
    g3d.bindTarget(ScreenCanvas.g);
    g3d.setViewport(0,0,ScreenCanvas.width, ScreenCanvas.height);
    bound = true;
    g3d.clear(background);
    g3d.render(worldGroup, worldTransform);
    } catch (Exception ex) {
    System.out.println("Game3d: "+ex.toString()+" "+ex.getMessage());
    }
    }
    finally
    {
    if (bound)
    {
    g3d.releaseTarget();
    }
    }
    }

  2. #2
    Registered User
    Join Date
    Mar 2004
    Posts
    18
    I've had the same problem... I solved it something like this:

    I presume you get your ScreenCanvas.width and .height by doing somthing like:

    (This is in the ScreenCanvas which I presume you extend from GameCanvas)..

    width=getWidth();
    height=getHeight();

    If this is done immidiatly after the canvas has been set as current displayable the width and height return from getWidth() and getHeight() are still refering to the dimensions of the Canvas...

    What I did was wait app. 200ms after setting the GameCanvas as the current on display... Something like this

    * Part of main class extending midlet. This code is

    public void run()
    {
    Display.getDisplay(this).setCurrent(ScreenCanvas);
    ScreenCanvas.init().
    }


    * This is part of ScreenCanvas extending GameCanvas

    public void init()
    {
    try {
    Thread.sleep(200);
    }
    catch(Exception e) {
    }

    width=getWidth();
    height=getHeight();

    .... etc. etc.
    }

  3. #3
    Registered User
    Join Date
    Jul 2004
    Posts
    10
    I have the same problem... The above solution didn't work for me. I set the my GameCanvas as the current displayable, waited, no effect. Could you maybe post a full example? Or did anyone else find a workaround for this?

    -Ray

  4. #4
    Registered User
    Join Date
    Feb 2004
    Posts
    6
    Did you set fullScreenMode(true)?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •