×

Discussion Board

Results 1 to 9 of 9

Thread: Drawing methods

  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    26

    Drawing methods

    hi developers!

    i just used the app-wizard for vc6 to create new apps for the series 60, i just got a derived class called CdemoContainer, humm... i just see a Draw() function, i put my draw code inside this function but...... aarrrggghhh.... this function is called by system and only redraws my screen when i push options and test it...


    how can i do to rewrite my draw function every tick????


    thanks

    kustom

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,168
    just call DrawNow(), when ever you need to draw the screen.

    yucca

  3. #3
    Registered User
    Join Date
    Dec 2003
    Posts
    26
    hum... thanks....


    only one question...

    where should i call the DrawNow() function???? i only have 4 classes in my project: CDemoApp, CDemoAppUI, CDemoDocument and CDemoContainer.

    should i crate a "timer" for calling DrawNow() every time???

    please help me

    kustom

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,168
    you'll just call it in your container class that implements the Draw() function.

    It's basically up to you, when you draw your screen, usually it would make sense to draw it some changes have occured to the information to be shown in the screen, so no need really to make timer just to re-fresh the screen without any changes.

    yucca

  5. #5
    Registered User
    Join Date
    Dec 2003
    Posts
    26
    lot of thanks symbianyucca :)


    then i could call DrawNow() from any function in CDemoContainer????

    well, i think that i have a more basic problem: where i can found a function to write my functions for drawing????

    why there arent a function like Main() when i can wirte my code like:

    while(1)
    {
    CalculeVertex();
    CalculeCamera();
    RenderAll();
    DrawnOW()
    }


    I CANT FOUND ANY SITE TO PUT MY CODE PIPELINE... :(((

  6. #6
    Registered User
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    12
    If you are looking a way to update the screen in a loop (realtime graphics), I'd suggest you to take a look on CDirectScreenAccess (Supported by SymbianOS 6.1 and up):

    1. Symbian paper about direct screen access techniques:
    http://www.symbian.com/developer/tec...een_access.pdf

    2. Berlin Factor site (French Dj) has lots of examples:
    http://www.berlinfactor.com/symbian.html

    Also there is some documentation at forum.nokia.com. E32frodo (c64 emulator w/ source code) serves as a good tutorial as well.

    All of the pointers I gave handles synchronization as well, so you will find out how they have implemented the "looping" :)

    -Juha

  7. #7
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,168
    you could also look at CActive class, making loops with active objects is in my opinion a lot better than using direct screen access, but again thats just my opinion.

    yucca

  8. #8
    Registered User
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    12
    My reply was a bit misleading (as I read it again), CDirectScreenAccess isn't any answer to original question, but articles (which are about it) most likely has the answer (with examples) :)

  9. #9
    Registered User
    Join Date
    Dec 2003
    Posts
    26
    thanks thanks and thanks

    both are great dudes


    my 3d engine is running each tick ;)


    thanks a lot of

    kustom

Posting Permissions

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