GLFW+ Freebasic

New to FreeBASIC? Post your questions here.
PavelUT
Posts: 78
Joined: Jun 14, 2021 14:42

Re: GLFW+ Freebasic

Post by PavelUT »

On my system, your program writes:
ppp.bas(259) error 42: Variable not declared, EXIT_FAILURE in 'return (EXIT_FAILURE)'
so replaced
return(EXIT_FAILURE)
on the
return(0)
respectively fprintf replaced with print
Of course, there will be no error messages in the output, but I didn’t come up with anything else
Accordingly, there is no need for
'#include once "crt/stdio.bi"
'#include once "crt/stdlib.bi"
removed 'extern "C"
and end extern
With these changes, your program starts and runs stably without any flickering.
srvaldez
Posts: 3373
Joined: Sep 25, 2005 21:54

Re: GLFW+ Freebasic

Post by srvaldez »

EXIT_FAILURE is defined in inc\crt\win32\stdlib.bi on a Windows system and probably in stdlib.bi wherever it may be located in your OS

Code: Select all

#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
srvaldez
Posts: 3373
Joined: Sep 25, 2005 21:54

Re: GLFW+ Freebasic

Post by srvaldez »

in the example examples\graphics\OpenGL\glfw_splitview.bas replace the do-loop in main with

Code: Select all

	do
		if doredraw then
			drawAllViews()
			glfwSwapBuffers()
			doredraw = 0
		end if
		glfwWaitEvents()
	loop while (glfwGetKey(GLFW_KEY_ESC) <> GLFW_PRESS) andalso glfwGetWindowParam(GLFW_OPENED)
and it runs smooth, no flickering
PavelUT
Posts: 78
Joined: Jun 14, 2021 14:42

Re: GLFW+ Freebasic

Post by PavelUT »

Thanks
Post Reply