Author Topic: Struggle with rendering soft-&hardwareimages simultaneous  (Read 3032 times)

0 Members and 1 Guest are viewing this topic.

Offline MrFreyer

  • Newbie
  • Posts: 34
    • View Profile
Struggle with rendering soft-&hardwareimages simultaneous
« on: November 01, 2019, 03:35:46 am »
Hi,

I have some problems with displaying soft- and hardwareimages simultaneously on the screen.

The following program should print some text, wait for a keyinput and then draw a grey box and also print some text while waiting for another keyinput...

Code: QB64: [Select]
  1. DEFINT A-Z
  2.  
  3. desktopscreen.width = _DESKTOPWIDTH
  4. desktopscreen.height = _DESKTOPHEIGHT
  5.  
  6. screenwindow.width = 1280
  7. screenwindow.height = 720
  8.  
  9.  
  10. SCREEN _NEWIMAGE(screenwindow.width, screenwindow.height, 32)
  11. _SCREENMOVE (desktopscreen.width * 0.5 - screenwindow.width * 0.5), 0
  12.  
  13.  
  14. 'SW = softwareimage / HW = hardwareimage
  15. DIM drawlayerSW AS LONG
  16. DIM drawlayerHW AS LONG
  17.  
  18. DIM boxpictureSW AS LONG
  19. DIM boxpictureHW AS LONG
  20.  
  21.  
  22. drawlayerSW = _NEWIMAGE(screenwindow.width, screenwindow.height, 32)
  23. drawlayerHW = _COPYIMAGE(drawlayerSW, 33)
  24.  
  25.  
  26. 'create boxpicture
  27. boxpictureSW = _NEWIMAGE(64, 64, 32)
  28. _DEST boxpictureSW
  29. LINE (0, 0)-(63, 63), _RGB(70, 70, 70), BF
  30. boxpictureHW = _COPYIMAGE(boxpictureSW, 33)
  31.  
  32.  
  33. 'draw boxpicture on drawlayer
  34. _PUTIMAGE (120, 120), boxpictureHW, drawlayerHW
  35.        
  36.        
  37. 'print text and wait for keyinput
  38. COLOR _RGB(255, 255, 255), _RGB(0, 0, 0)
  39. _PRINTSTRING (0, 0), "TESTTEXT 1 - Press any key"
  40.  
  41.    
  42. 'draw drawlayer and print text, wait for keyinput
  43.     CLS
  44.  
  45.     _PUTIMAGE (0, 0), drawlayerHW
  46.  
  47.     COLOR _RGB(255, 255, 255), _RGB(0, 0, 0)
  48.     _PRINTSTRING (0, 0), "TESTTEXT 2 - Press any key"
  49.      
  50.     _DISPLAY
  51.  
  52.  
  53.  

What I get: print NO text and wait for keyinput, draw box and print text while waiting for keyinput, print text AGAIN while waiting for ANOTHER keyinput :D I do something wrong with the destinationimages or displayorder, I think...

Thanks
« Last Edit: November 01, 2019, 03:44:38 am by MrFreyer »

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: Struggle with rendering soft-&hardwareimages simultaneous
« Reply #1 on: November 01, 2019, 09:04:33 am »
Hi MrFreyer!
Your program is running fine on my system. I have found no issue in running it on my laptop.
Which version of QB64 are you using??
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline MrFreyer

  • Newbie
  • Posts: 34
    • View Profile
Re: Struggle with rendering soft-&hardwareimages simultaneous
« Reply #2 on: November 01, 2019, 10:29:23 am »
I'm using version 1.3 win x64...

You get the screen with "TESTTEXT 1 - Press any key"?
I just get a black screen :/

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: Struggle with rendering soft-&hardwareimages simultaneous
« Reply #3 on: November 01, 2019, 10:32:24 am »
I'm using version 1.3 win x64...

You get the screen with "TESTTEXT 1 - Press any key"?
I just get a black screen :/
Yes. I do get that. By the way, I am using dev. Mode of qb64.
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Struggle with rendering soft-&hardwareimages simultaneous
« Reply #4 on: November 01, 2019, 11:06:20 am »
I can confirm Ashish results, I get text also before a keypress...

My toolbar is on left side so _SCREENMOVE is off for me but..
  [ You are not allowed to view this attachment ]  

vers 1.3 standard issue
« Last Edit: November 01, 2019, 12:39:04 pm by bplus »