Jump to content

  • Log In with Google      Sign In   
  • Create Account

Mixing SFML and Horde3D: operation not allowed in current state


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 mystb   Members   -  Reputation: 186

Like
0Likes
Like

Posted 09 April 2013 - 08:32 AM

Helo,

 

I'm trying to get a mix of lua, horde3d and SFML up and running, but I've come across a problem that I'm unable to solve.

I already built everything and I made up a test scenario with SFML only output:

 

exampleyl.png

 

Just some random labels:)

I tried to incorporate Horde3D, but that simply fails. So, I just commented out the SFML output, and voila:

 

70386192.png

 

That's a simple Tetris like piece.

 

But if I try to have both at the same time, the application crashes.

I "know" the problem must reside in the opengl states, and I tried to push and pop the states, but haven't figured it out.

 

Here's the code (in one snippet but scatered through some files):

function window:create(cfg)
  ...
  ...
  llwindow.set_window_style(style)
  llwindow.create_window(title)

  self:pushStates() -- [1]
end

function window:pushStates()
	llwindow.get_handle().__RenderTarget__:pushGLStates()
end

function window:popStates()
	llwindow.get_handle().__RenderTarget__:popGLStates()
end

function window:resetStates()
	llwindow.get_handle().__RenderTarget__:resetGLStates()
end

function render:tick()
	self:setWireFrameMode(self.d3doptions.WireFrameMode)
	self:setDebugViewMode(self.d3doptions.DebugViewMode)
	window:clear()
	self.camera.object:update()
	llrender.render(self.camera.object) --[2]

	
	window:popStates() --[3]
	window:resetStates() --[4]
	overlaymanager:tick(self.dimensions) --[5]
	window:pushStates() --[6]
	
	llrender.finalize()	--[7]
	window:display()
end

With 1,3,4,5,6 enabled and 2,7 commented out, SFML outputs ok, but outputs this message once:

 

An internal OpenGL call failed in RenderTarget.cpp (269) : GL_INVALID_OPERATION, the specified operation is not allowed in the current state


 

With 1,3,4,5,6 commented and 2,7 enabled Horde3d outputs ok.

 

With any combination of these... app crashes first time that llrender.render(self.camera.object)  is called or after outputting several GL_INVALID_OPERATION messages like above.

 

Any help would be appreciated smile.png

 

P.S: sorry for my spelling/grammar, I'm portuguese.


Edited by mystb, 09 April 2013 - 08:37 AM.


Sponsor:

#2 DemonDar   Members   -  Reputation: 153

Like
0Likes
Like

Posted 16 April 2013 - 12:05 AM

are you mixing OpenGL with d3d? O_O that's not valid unless you have different windows. 1 window with GL and 1 window with DX.

 

OpenGL call fails because there is no valid active GL context (because you have d3d context).

 

In your case having DX / GL calls wrapped by some other library does not magically remove that low-level issue such as the one of active graphics context. You can't forget about everything about hardware and other APIs.


Edited by DemonDar, 16 April 2013 - 12:11 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS