It is currently Mon Sep 28, 2020 6:47 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: bug TextureOutput
PostPosted: Wed Aug 19, 2020 9:10 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Jul 09, 2015 9:07 am
Posts: 111
TextureOutput is behaving strangely:

under directx
the following program crash
Code:
InitEngine3D():InitSprite():InitKeyboard():InitMouse()
OpenWindow(0, 0, 0, 0,0, "",#PB_Window_Maximize)
OpenWindowedScreen(WindowID(0), 0, 0, 800,600, 0, 0, 0)
CreateTexture(0,256,256)
Debug TextureOutput(0)
;StopDrawing()
Debug TextureOutput(0)

but if I put "StopDrawing()"
after the first call to "TextureOutput,"
no crash


under opengl, even weirder:
Code:
InitEngine3D():InitSprite():InitKeyboard():InitMouse()
OpenWindow(0, 0, 0, 0,0, "",#PB_Window_Maximize)
OpenWindowedScreen(WindowID(0), 0, 0, 800,600, 0, 0, 0)
CreateTexture(0,256,256*3)
StartDrawing(TextureOutput(0))
StopDrawing()
Debug TextureOutput(0)

here, the dimensions of the texture are not a power of 2
but if I put a power of 2( CreateTexture(0,256,256), no crashing


tested with PB 5.72(x64)


Top
 Profile  
Reply with quote  
 Post subject: Re: bug TextureOutput
PostPosted: Thu Aug 20, 2020 9:59 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Dec 23, 2009 3:26 pm
Posts: 212
OutputID = TextureOutput(#Texture)

Returns the output ID or zero if drawing is not possible. This value should be passed directly to the StartDrawing() function to start the drawing operation. The return-value is valid only for one drawing operation and cannot be reused.

according to the doc
Code:
InitEngine3D():InitSprite():InitKeyboard():InitMouse()
OpenWindow(0, 0, 0, 0,0, "",#PB_Window_Maximize)
OpenWindowedScreen(WindowID(0), 0, 0, 800,600, 0, 0, 0)
CreateTexture(0,256,256)
CreateTexture(1,256,256)
Debug TextureOutput(0)
;StopDrawing()
Debug TextureOutput(1)


above is ok
I think StopDrawing finished your first output drawing call ,so it won't crash after the second call.

_________________
poor English...

PureBasic & Delphi & VBA


Top
 Profile  
Reply with quote  
 Post subject: Re: bug TextureOutput
PostPosted: Mon Sep 14, 2020 10:19 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14090
Location: France
The only way to use an Output() command is to put it in a StartDrawing() block, because int/cleanup of the output are done in StartDrawing()/StopDrawing(). Just using 'Debug TextureOutput()' is not supported.

Can you confirm the following code still crash for you ?

Code:
InitEngine3D():InitSprite():InitKeyboard():InitMouse()
OpenWindow(0, 0, 0, 0,0, "",#PB_Window_Maximize)
OpenWindowedScreen(WindowID(0), 0, 0, 800,600, 0, 0, 0)
CreateTexture(0,256,256)
If StartDrawing(TextureOutput(0))
  StopDrawing()
EndIf

If StartDrawing(TextureOutput(0))
  StopDrawing()
EndIf


Top
 Profile  
Reply with quote  
 Post subject: Re: bug TextureOutput
PostPosted: Mon Sep 14, 2020 6:40 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Jul 09, 2015 9:07 am
Posts: 111
as I said above, with opengl, if the dimension of the texture is not a power of 2, the second startdrawing call causes a crash


Top
 Profile  
Reply with quote  
 Post subject: Re: bug TextureOutput
PostPosted: Thu Sep 17, 2020 7:28 am 
Offline
Enthusiast
Enthusiast

Joined: Wed May 27, 2020 12:26 pm
Posts: 140
Hello pf shadoko,

it is as normal as opengl tells us (open source) that this depends of the hardware.


Top
 Profile  
Reply with quote  
 Post subject: Re: bug TextureOutput
PostPosted: Fri Sep 18, 2020 10:07 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Jul 09, 2015 9:07 am
Posts: 111
no it's certainly a bug
the first startdrawing works


Top
 Profile  
Reply with quote  
 Post subject: Re: bug TextureOutput
PostPosted: Sat Sep 19, 2020 7:40 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed May 27, 2020 12:26 pm
Posts: 140
@pfshadoko

Please "quote" the code whom you are talking about. My previous message is for your remark about non-2^N texture size on OpenGL.

If it is the code of Fred which is crashing, it is a bug. In this way, adding the subsystem which is crashing will help to isolate the problem.


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: Krix and 3 guests


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