It is currently Mon Jul 06, 2020 10:02 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: DisplayTransparentSprite is taking too long to process
PostPosted: Tue Mar 17, 2020 9:01 pm 
Offline
User
User

Joined: Sat Sep 21, 2019 4:24 pm
Posts: 23
Hi!
In this particular computer, here are the specifications:
Operating System
Windows 10 Pro 64-bit
CPU
Intel Core i5 3330 @ 3.00GHz
Ivy Bridge 22nm Technology
RAM
8,00GB Dual-Channel DDR3 @ 798MHz (11-11-11-28)
Motherboard
PEGATRON CORPORATION IPMH61P1 (SOCKET 1155)
Graphics
DELL E1911 (1440x900@64Hz)
Intel Adaptador de Vídeo Básico da Microsoft (Unknown)

PureBasic 5.71 LTS (Windows - x64)

I'm drawing a map that is 20x15 tiles, each tile is 16x16 pixels. The tiles are zoomed by a factor of 2 (making them 32x32 pixels), and the screen resolution is 640x480 pixels. Drawing the 300 tiles in the screen is taking on average 10 ms, which is making the movement sluggish. Here is a link with the source code for download:
https://drive.google.com/open?id=1B5u6MRaNEcqbXcaUC4M4IHLxLOmJL7nr

You can move the sprite with the arrow keys. Why would DisplayTransparentSprite take so long to draw the tiles?
Thanks.


Top
 Profile  
Reply with quote  
 Post subject: Re: DisplayTransparentSprite is taking too long to process
PostPosted: Tue Mar 17, 2020 9:30 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Sep 11, 2016 2:17 pm
Posts: 683
Are u sure u have the debugger disabled?
For me its faster than 1 ms !

My quick test:
Code:
Procedure Draw()
  Protected clk.q
  TimeTaken = 0
  clk = ElapsedMilliseconds()
  For i.a = 0 To MapWidthInTiles - 1
    For j.a = 0 To MapHeightInTiles - 1
      DungeonMapSprites(i, j)\DrawSprite(@DungeonMapSprites(i, j))
     
    Next j
  Next i
  SetWindowTitle(0,Str(ElapsedMilliseconds() - clk))
  Heroine\DrawSprite(@Heroine)
  For i.a = 0 To 1
    For j.a = 0 To 1
      PaddlesSprites(i, j)\DrawSprite(@PaddlesSprites(i, j))
    Next j
  Next i
EndProcedure


Top
 Profile  
Reply with quote  
 Post subject: Re: DisplayTransparentSprite is taking too long to process
PostPosted: Tue Mar 17, 2020 9:32 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14065
Location: France
the integrated GFX card is probably very slow, as this is a very basic drawing operation and should be very very fast. Or may be a driver issue. You could try to switch to OpenGL subsystem to see if it does a difference


Top
 Profile  
Reply with quote  
 Post subject: Re: DisplayTransparentSprite is taking too long to process
PostPosted: Tue Mar 17, 2020 10:06 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Oct 09, 2007 2:15 am
Posts: 1127
he has no driver installed... Normally it's Intel HD Graphics 2500.

Driver (Intel) : https://downloadcenter.intel.com/de/dow ... duct=65509 (Sorry ... german language)

_________________
PureBasic 5.72 LTS (Windows x86/x64) | Windows10 Pro x64 | Z370 Extreme4 | i7 8770k | 32GB RAM | iChill GeForce RTX 2080 Super | HAF XF Evo​​
English is not my native language... (I often use DeepL to translate my texts.)


Top
 Profile  
Reply with quote  
 Post subject: Re: DisplayTransparentSprite is taking too long to process
PostPosted: Wed Mar 18, 2020 1:03 am 
Offline
User
User

Joined: Sat Sep 21, 2019 4:24 pm
Posts: 23
@Mijikai: Debugger or not debugger I got more or less the same result.

@Fred and @Bisonte: It could be some weak ass onboard graphic with no driver issue! I'll try to install the drivers and report back.

Thank you all for now!


Top
 Profile  
Reply with quote  
 Post subject: Re: DisplayTransparentSprite is taking too long to process
PostPosted: Wed Mar 18, 2020 1:43 pm 
Offline
User
User

Joined: Sat Sep 21, 2019 4:24 pm
Posts: 23
It was a driver issue! I installed the video drivers as suggested and the rendering is fast now. From now on I might be able to suggest this if someone complains about the slowness. Thanks :D


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye