Jump to content
  • Advertisement
Sign in to follow this  

GTK+/gtkmm and DirectX?

This topic is 2118 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I use Java and OpenGL but the main idea may help you.

I tend to use three separate threads: the "main()", the GUI with the tools and an instance of the game "window" (working as the "world editor"). The "main" has a simple job: start the GUI and the "game" and link both with each other. The way to "link" them is by using java "interfaces" (implementing Listener pattern): GUI implements something like WorldBuilderEventListener and WorldEditor implements something like GUIEventListener (with methods as "setPlayerPos(x,y,z)" and the like). So, the "main()" is like:

[font=courier new,courier,monospace]main(){[/font]

gui = GUI(); // class GUI implements WorldBuilderListener { ... }

worldBuilder = WorldBuilder(); // class WorldBuilder implements GUIListener { ... }



// wait for threads to end
[font=courier new,courier,monospace]}[/font]

There's another option: using processes instead of threads (as may be the case if there's no natural integration between GTK+ and DirectX). In this case, my advice is to use sockets to communicate between GUI and WorldEditor.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!