side4linux, a simple integrated development
Demo-2 Load, Re-Compile and Run the 'Bdesign3d' project's visuals,
OpenGL 3D Project.
provide a basic introduction to recompiling a Glade-3, OpenGL, 3D,
- We will do this by
opening the 'Bdesign3d' Project, a three dimensional OpenGL Project.
- This example of a
two dimensional template re-configured to three dimensions ( please
refer to 'Demo-1' for the 2D original template ),
- is the basic
'shell' of the Bdesign3d Project copied into the DEMOS area for use in
- To learn how to 'auto-generate' a new Project with
the Glade-3 GUI Builder and side4linux IDE read GNOMEC Demo-3.
- Note: This Demo is
intended to be
built using Glade-3 and not Glade-2 which is now deprecated.
- Make sure that the 'GNOME' build
environment is installed
- if not then read 'setup
environment.txt' and also 'setup
- Make sure that you have a working
OpenGL environment with all of the 'dev' packages installed ( run
'glxgears' from a terminal as a start ).
- If your Distribution's OpenGL does not
work correctly then download and install 'Mesa' from mesa.org.
- You should be able to create a new
Gnome CGL Project in the same manner as in GNOMEC Demo-3.
- Make sure that you have read GNOMEC
- Do Demo-1 first!
- Make sure that Glade-3 is installed
and re-compile it.
- Open 'side4linux' and click on 'Project>Open Project' in
the Main Menue.
- Select 'DEMOS>SIDEdemos>GNOMECGL>Bdesign3d>bdesign3d.prf'
as in figure-1 below and click on 'Open'
in the Dialog Box.
- Re-Build the Project to ensure that it links with your
installation's dynamic libraries.
- 'Build>Autogen Project'
- 'Build>Make Clean'
- Notice the 'Build Status
Window' ( third from left at the bottom of the screen ) says 'Pbuild: OK!'. If not check
the 'Output Window' for errors
like missing library.
- Now open the Glade-3 GUI builder program, 'Edit Project>Edit
Project Visuals with Glade-3'
- ( un-dock the windows and shrink the Main
window to about
one third screen size )
- Click on the 'mainWindow'
widget in the 'Inspector'
window and open down to 'hbox2'
- Double click on 'mainWindow'
in the 'Inspector'
window to make it appear in the 'Glade-3 Main window'
- Notice the highlighted 'hatched
in the middle of the 'mainWindow'
widget, in 'main.c' there will
inserted here a 'glarea' Widget
- Now close the Glade-3 GUI Builder program.
- Click on 'Open-TXT'
and open 'main.c'.
- Notice in line 99 , glareaContainer =
glade_xml_get_widget(gladeXML,"hbox2"); // gets us the pointer to
- Notice in line 100 , gtk_container_add(GTK_CONTAINER(glareaContainer),GTK_WIDGET(glarea));
- This is our 'glarea'
widget where we can render OpenGL images using OpenGL commands.
- Notice in line 100 , GLarea_Init3d(glarea); // comment this out
if you need 2d
- This is different to the
template as the auto-generated template is setup for 2D.
Exercise-2: Run the
Project and Discover other
- Change to another workspace and open a terminal program in
- We will 'run' the
Program 'bdesign3d' in a
- and run the program ( ./bdesign3d ) notice the full stop
forward slash to run a program in the current directory to get the
following messages ( or similar ),
- then click on the 'ReDraw'
Tool button in the program to create a 3D wire-frame cube. Try some of
the other Tool butons to rotate/rescale/clear etc.
Trying local 'glade' file
Local 'glade' file found!
gdk_gl_choose_visual() visual depth = 24
Mesa: CPU vendor: GenuineIntel
Mesa: MMX cpu detected.
Mesa: SSE cpu detected.
Mesa: Not testing OS support for SSE, leaving enabled.
Mesa: Mesa 7.0.2 DEBUG build Jan 12 2008 13:36:46
Opening 'Bdesgin3d' number of arguements = 1
opening string is './bdesign3d' ''
- Try dragging the window wider,
notice that the GL image does not resize to fill the new window
- Click on the 'ReDraw' button to
resize the GL image.
- Try the 'About Box',
- Close the 'Bdesign3d' program
window by clicking
on the top right 'X'.
- Return to the workspace that
contains the sied4linux IDE,
- Notice that with Glade-3 you do
not need a 'calbacks.h' file now.
- Close the 'bdesign3d' project
We will provide other demos as
'side4linux' develops to
cover GNOME visual programming and integration into a real world
GUI interface made with Gtk and Glade