×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    10

    Graphics3D.setViewport() does not work as expected on S60 3rd FP2

    Hello,

    I have made an application which is using the JSR184 (3D graphics) API. I am rendering a mesh on the display with this simple code:
    public void drawHorizon(Graphics g) {
    graphics3D.bindTarget(g);
    graphics3D.setViewport(0, 0, getWidth, getHeight);
    graphics3D.clear(null);
    graphics3D.render(horizon, null);
    graphics3D.releaseTarget();
    }

    getWidth and getHeight are updated in the sizeChanged() in my GameCanvas clas object.

    My main problem is that on a Nokia 6210 Navigator, only a square in the screen is cleared and displayed (the lower part stays untouched). The same application works fine on a Nokia 6131.
    I have tried to hard coded getWidth and getHeight to see the behavior and when they are lower than the display dimension, it works fine. But as soon as one of them become higher or equal to the size of the screen, only the upper part of the screen is updated.

    Does anyone know about problem of JSR184 on this phone (s60 3rd Ed FP2)? I did a quick search but did not found anything. I have investigated my code but did not find anything also.

    Here is a link to the application:
    http://sideralis.free.fr/Beta/Sideralis2.jar

    Press 2 times '*' to see the problem.

    Thanks and best regards.
    Last edited by gautierb; 2009-12-30 at 20:47.

  2. #2
    Registered User
    Join Date
    Nov 2006
    Posts
    10

    Re: Graphics3D.setViewport() does not work as expected on S60 3rd FP2

    Hello,

    I have continued my investigation, and I succeeded to reproduce my problem with a smaller code. So here again is what I see on my Nokia 6210 Navigator (and also on a N96, so all S60 3rd FP2). The application is rendering a mesh. This works fine and all screen is updated. Then I rotate the device. sizeChanged function is called and getWidth() and getHeight() are now returning the right values, but, now only the left side of the display is updated (the right part remains white).
    It looks like the 2nd call to setViewport() is not taken into account.
    I have also partly solved my problem by moving the setFullScreen(true) call in the constructor of my GameCanvas. Previously it was called after having created the GameCanvas object. But I still have a problem when rotating the mobile.
    I will continue my investigation

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    10

    Re: Graphics3D.setViewport() does not work as expected on S60 3rd FP2

    Finaly, I solved my problem by switching from GameCanvas to Canvas. And now it works.
    Maybe I am doing something wrong or there is a bug on my Nokia...

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Graphics3D.setViewport() does not work as expected on S60 3rd FP2

    This might explain why I've never seen this problem, as I always use Canvas.

    Sometimes, switching from Canvas to GameCanvas fixes a problem. Since it's easier to swich from Canvas to GameCanvas than the other way around (if you might have used some GameCanvas features), I always recommend using Canvas.

    Well done, sorry no one could help you, and thanks for sharing!

    Graham.

Similar Threads

  1. Replies: 10
    Last Post: 2009-10-30, 08:59
  2. Replies: 35
    Last Post: 2009-04-11, 14:36
  3. Replies: 1
    Last Post: 2009-03-04, 15:42
  4. Replies: 0
    Last Post: 2008-10-02, 14:17
  5. What is going on with Vibration on S60?
    By amd_rikus in forum Mobile Java General
    Replies: 3
    Last Post: 2006-06-16, 00:29

Posting Permissions

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