Skip to content

Instantly share code, notes, and snippets.

@zester
zester / main.cpp
Created August 29, 2011 03:46
Skia Graphics Library Example (Note: Use to work)
#include "SkCanvas.h"
#include "SkGraphics.h"
#include "SkImageEncoder.h"
#include "SkString.h"
#include "SkTemplates.h"
int main (int argc, char * const argv[]) {
//
SkAutoGraphics ag;
@zester
zester / gist:1180077
Created August 30, 2011 03:07
Howto load an external qt stylesheet
QFile file(":/qss/default.qss");
file.open(QFile::ReadOnly);
QString styleSheet = QLatin1String(file.readAll());
setStyleSheet(styleSheet);
@zester
zester / gist:1185753
Created September 1, 2011 09:01
Parse a .desktop file with Qt
QSettings settings("/home/steven/Desktop/dolphin.desktop", QSettings::IniFormat);
settings.beginGroup("Desktop Entry");
qDebug() << settings.value("Name").toString();
qDebug() << settings.value("Exec").toString();
qDebug() << settings.value("Icon").toString();
qDebug() << settings.value("Type").toString();
// Defect cant git list
qDebug() << settings.value("Categories").toString();
qDebug() << settings.value("GenericName").toString();
qDebug() << settings.value("Terminal").toString();
@zester
zester / gist:1214859
Created September 13, 2011 19:39
QtXml QDom Example
#include <QtXml>
#include <iostream>
int main(int argc, char *argv[])
{
QDomDocument doc("mydoc");
QFile file("shared-mime-info.xml");
if(!file.open(QFile::ReadOnly | QFile::Text)) return 1;
if(!doc.setContent(&file)) {
file.close();
@zester
zester / gist:2402686
Created April 17, 2012 01:07
Skia and SFML2
#include <SFML/Graphics.hpp>
#include "SkCanvas.h"
#include "SkGraphics.h"
#include "SkImageEncoder.h"
#include "SkString.h"
#include "SkTemplates.h"
#include "SkTypeface.h"
#include <iostream>
@zester
zester / SFML2 and OpenSceneGraph 3
Created April 17, 2012 01:08
SFML2 and OpenSceneGraph 3
// g++ main.cpp -o main -lsfml-window -lsfml-graphics -lsfml-system -losg -losgDB -losgGA -losgUtil
#include <SFML/Graphics.hpp>
#include <osgUtil/SceneView>
#include <osg/Node>
#include <osg/CameraNode>
#include <osg/Group>
#include <osgDB/ReadFile>
@zester
zester / gist:2402698
Created April 17, 2012 01:10
Horde3D and SFML2 (Not Fully Working)
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
#include <horde3d/Horde3D.h>
#include <horde3d/Horde3DUtils.h>
#include <iostream>
@zester
zester / gist:2402705
Created April 17, 2012 01:11
Ogre3D Basic Example
// g++ main.cpp -o main `pkg-config --libs --cflags OGRE OIS`
#include <Ogre.h>
#include <OgreFrameListener.h>
#include <iostream>
using namespace Ogre;
//
class MyFrameListener : public FrameListener {
@zester
zester / gist:2402714
Created April 17, 2012 01:13
Maratis3D and SFML2
#include <SFML/Graphics.hpp>
#include <MCore.h>
#include <MEngine.h>
#include "MGLContext.h"
#include <iostream>
int main()
{
// Create the main window
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
@zester
zester / gist:2402725
Created April 17, 2012 01:15
Panda3D C++ Example
//g++ main.cpp -o main -I/usr/include/panda3d -L/usr/lib/panda3d -I/usr/include/python2.7
//-lp3framework -lpanda -lpandafx -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3pystub -lp3direct
#include "pandaFramework.h"
#include "pandaSystem.h"
#include "genericAsyncTask.h"
#include "asyncTaskManager.h"