Jump to content
  • Advertisement
Sign in to follow this  
Lode

Cross platform C++ library for clipboard, files, etc...

This topic is 3174 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

Hi, I'm using C++ with SDL and OpenGL and can do quite a bit of things cross-platform with it, such as 2D and 3D graphics, audio, keyboard and mouse input, etc... But I'm missing a few things which are afaik not supported by SDL or OpenGL. These are: -getting data from the clipboard of the operating system. Both images and text... -browsing through files. This is possible with boost so I might use that. -taking a screenshot of the whole screen (not just inside my own application, but of everything the OS is showing on screen) -doing operating system commands, such as starting up another application Are there any small cross platform libraries that can do one or more of these things? I prefer small ones that do just that. Something like wxwidgets might be able to do some of these but it's not good for me because wxwidgets does much more things which I don't need. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Taking screenshot: http://planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=10754&lngWId=3
Hope it helps. Also it seems to include taking image from Clipboard, I hope it helps you with that too :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Lode
But I'm missing a few things which are afaik not supported by SDL or OpenGL.

These are:

-getting data from the clipboard of the operating system. Both images and text...
-browsing through files. This is possible with boost so I might use that.
-taking a screenshot of the whole screen (not just inside my own application, but of everything the OS is showing on screen)
-doing operating system commands, such as starting up another application

Are there any small cross platform libraries that can do one or more of these things?
Not really, and part of that is because it depends very heavily what you mean by cross-platform.

For instance, screen shots outside the application: SDL and OpenGL both support many platforms where there is nothing outside of your application (i.e. game consoles, handheld devices such as the iPhone, DOS...).

Now, I assume that by cross-platform you mean the big 3: Windows, Mac and Linux. Unfortunately, even there you have problems. Consider starting up another application - but each platform has different applications for the same job, and even when they are named similarly, they may behave very, very differently.

For instance, even though they perform the same basic task, the 'find' utility on Windows works entirely differently to the 'find' command on Linux, or Spotlight on the Mac.

The gist of this is that you need to define your requirements in very specific terms, before we can be of much assistance. If your task is specific, such as 'load such and such a page in the default web browser', then someone ought to be able to help [smile]

Share this post


Link to post
Share on other sites
The most specific thing I could use, is accessing the clipboard.

The files I have now, I decided to use boost::filesystem for it. The taking of the screenshot isn't so important if the clipboard works, since you can take the screenshot with print screen and usually it goes to the clipboard then.

Is there any cross platform way to access the clipboard?

So two very specific use cases would be:

-you select some text in a text editor in the OS and press ctrl+c. You press ctrl+v in my application in some text edit control which is rendered in OpenGL, and there appears the text
-you select an image in the most basic painting program of the OS or have pressed some key combination involving print screen, so that an image is on the clipboard. You press ctrl+v in my application, and an OpenGL texture is created with the image data from the clipboard on it.

Share this post


Link to post
Share on other sites
Quote:
Original post by Lode
Is there any cross platform way to access the clipboard?
Nope, though IrrLicht included basic clipboard handling for text at one point (probably still does).

I would however question whether such features are wise - if you need all this platform interaction, maybe your OpenGL rendering should be embedded in a real GUI toolkit, such as wxWidgets, QT or AWT/Swing?

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!