Welcome

Welcome to the SFEX (Simple and Fast Extensions) wiki page! Here you can access to the forum post here.

Description

This library provides multiple extensions to SFML. At this release you can check the system RAM, get info about the CPU, the GPU and even about the OS.

I hope you don't have any problem with this. It is multiplatform, but I just work with Visual Studio, so I will support only VS projects. There are few files in the source, so it can't be much hard to compile under Linux or Mac anyway.

Installation

In order to use SFEX, you must have installed:

Note that Glew and Sigar are actually provided in the folder called “dependencies”.

You must link to your projects with:

  • opengl32
  • glu32
  • sigar
  • glew
  • sfml system
  • sfml window
  • sfml graphics
  • sfex

And maybe you will have to provide Glew and Sigar .dll's. They are also at “dependencies” folder.

Tutorial

A sample is included in the package. It is very simple to use. The hard part is to add the path of the dependencies to your compiler, and then link to the corresponding libs.

#include <iostream>
#include <SFEX.hpp>
 
int main()
{
	// We must init sfex before any call
	sfex::Init();
 
	// System
	std::cout << "--- SYSTEM ---" << std::endl;
	std::cout << sfex::System::GetVendor() << ", " << sfex::System::GetVendorName()
		<< ", " << sfex::System::GetArchitecture() << std::endl;
	std::cout << sfex::System::GetDescription() << std::endl;
	std::cout << sfex::System::GetPatchLevel() << std::endl;
 
	// Ram
	std::cout << "--- RAM ---" << std::endl;
	std::cout << sfex::Ram::GetFree() << "/" << sfex::Ram::GetTotal() << " Mbytes of RAM" << std::endl;
 
	// Gpu
	std::cout << "--- GPU ---" << std::endl;
	std::cout << "GL version: " << sfex::Gpu::GetGlVersion() << std::endl;
	std::cout << "GLSL version: " << sfex::Gpu::GetGlslVersion() << std::endl;
	std::cout << "Renderer: " << sfex::Gpu::GetRenderer() << std::endl;
	std::cout << "Vendor: " << sfex::Gpu::GetVendor() << std::endl;
 
	const sfex::Version &GlVersion = sfex::Gpu::GetGlVersion2();
	std::cout << "GL version: " << GlVersion.Major << "." << GlVersion.Minor << std::endl;
 
	// We must close sfex at the end
	sfex::Close();
}
 
// IMPORTANT (Only for Visual Studio compilers!): Link to...
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")
#pragma comment(lib, "sigar-x86-winnt.lib")
#ifdef _DEBUG
#pragma comment(lib, "sfml-system-d.lib")
#pragma comment(lib, "sfml-window-d.lib")
#pragma comment(lib, "sfml-graphics-d.lib")
#pragma comment(lib, "glew32d.lib")
#else
#pragma comment(lib, "sfml-system.lib")
#pragma comment(lib, "sfml-window.lib")
#pragma comment(lib, "sfml-graphics.lib")
#pragma comment(lib, "glew32.lib")
#endif

Download

Release 1

SFEX with dependencies (3.828 KB): Click here.

SFEX without dependencies (248 KB): Click here.

Next version

I'm already working in the next version. You won't need to init or close SFEX anymore. Also you won't have to link to SFML graphic library (which is so heavy).

 
en/projects/sfex.txt · Last modified: 2010/05/01 17:58 by panithadrum
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki