bug TextureOutput

All bugs related to the 3D engine
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 291
Joined: Thu Jul 09, 2015 9:07 am

bug TextureOutput

Post by pf shadoko »

TextureOutput is behaving strangely:

under directx
the following program crash

Code: Select all

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: Select all

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)
User avatar
leonhardt
Enthusiast
Enthusiast
Posts: 220
Joined: Wed Dec 23, 2009 3:26 pm

Re: bug TextureOutput

Post by leonhardt »

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: Select all

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
Fred
Administrator
Administrator
Posts: 16681
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: bug TextureOutput

Post by Fred »

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: Select all

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
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 291
Joined: Thu Jul 09, 2015 9:07 am

Re: bug TextureOutput

Post by pf shadoko »

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
Olli
Addict
Addict
Posts: 1071
Joined: Wed May 27, 2020 12:26 pm

Re: bug TextureOutput

Post by Olli »

Hello pf shadoko,

it is as normal as opengl tells us (open source) that this depends of the hardware.
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 291
Joined: Thu Jul 09, 2015 9:07 am

Re: bug TextureOutput

Post by pf shadoko »

no it's certainly a bug
the first startdrawing works
Olli
Addict
Addict
Posts: 1071
Joined: Wed May 27, 2020 12:26 pm

Re: bug TextureOutput

Post by Olli »

@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.
Post Reply