


In order for the button to do anything, we need to add a callback function. The arguments to the button’s constructor are it’s position (x,y), dimensions (w,h), and a title. FLTK calls things like buttons and sliders “widgets,” and they all must be included individually just like the Fl_Window class.Ĭreating a button is just like creating a window:įl_Button myButton(10, 10, 100, 25, "Push me!") If Visual Studio is configured correctly, running this program should display an 800×600 window with “Hello World” as the title and absolutely nothing inside! That’s boring, so let’s add some widgets. The FLTK “Hello World”įl_Window myWindow(800, 600, "Hello World") The OpenGL Survival Guide is recommended reading. The stuff about setting up Visual Studio 2005 projects is a bit different, but you can look at the Base project for how to do it with 2013. To get a sense of how FlTk works, especially how it interacts with OpenGL, there are tutorials from the 2007 edition of the class. FLTK allows you to have on-screen buttons, sliders, menus, and more along with a fully interactive OpenGL window.

Past semesters have used tools such as freeGLUT to create windows, but FLTK has additional functionality. We’ll give you framework code for the projects that use it and do most of what you need.įLTK (Fast Light Toolkit) is the window manager we will use this semester. Note: You won’t have to learn much about FlTk. This project was made with Visual Studio 2013, so it will be compatible with the software in the CSL. You can then download our 559 Base Project, which should have all the correct configuration options set properly. For yourself, you might prefer to put the libraries in different places – but putting them in the same place as CSL does will save you hassle when you go to move your code to the lab machines (which you will have to do to turn projects in). Note: putting libraries in your Program Files directory is only for getting your personal machine set up to be like the CSL machines. Download it here and extract it to your Program Files (x86) directory. We have provided a zip package of all the tools we will use for the projects. See the first Visual Studio tutorial for details. Make sure you have Visual Studio set up on your computer before doing this tutorial.
