Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - cfrankb

Pages: [1]
1
Graphics / sf::RenderWindow vs sfml/qt
« on: July 23, 2010, 12:22:40 am »
Situation:

I'm using OpenSuse 11.3 with the opensource "radeon" driver for my ATI X1200 (RS690). Performance is worse than it was under 11.2. Funny thing is that qt/SFML app gives me better framerate (within tolerance) than the solo SFML window (way too slow).

Questions

What is the difference in implementation between a sf::RenderWindow and SFML/qt view? Is the former using overlay? If that is the case, it is possible to disable the use of overlay as the "radeon" driver doesn't seem to support them?

Regards,
Frank B.

2
General / Converting keycodes
« on: July 04, 2010, 11:25:20 am »
Is there an easy way to convert qt keycodes to SFML and vice versa?

Regards,
Frank B.

3
SFML projects / 2D Game Construction Kit - updated to v. 0.6.0.8
« on: June 25, 2010, 10:17:02 am »
Project

LGCK-Builder

Brief Description

A free all-in-one game construction kit targeted to be both powerful yet simple to use. 

Technology

Platforms:
    - Windows (XP, Vista, 7, 8, 10)
    - Linux (tested under Ubuntu), Wine and Virtualbox
    - Mac (tba)

Screenshots




Contacts

https://cfrankb.com/lgck/contact.php

Website
   


https://cfrankb.com/lgck

Downloads

https://cfrankb.com/lgck/download.htm

Follow us on twitter
http://twitter.com/lgckbuilder

See the videos about LGCK Buidler
http://www.youtube.com/user/cfrankb2000

Read about the latest developments
http://lgckbuilder.blogspot.ca/

LGCK Builder: 2D Game Construction Kit
https://cfrankb.com/lgck

Feedback

Feedback, suggestions and feature requests are welcomed and encouraged. :D

4
Audio / Error message with sfml-audip
« on: December 20, 2009, 08:20:17 am »
Hi,

This is error message I'm getting: AL lib: pulseaudio.c:386: Context did not get ready: Connection refused

What does it mean? What's causing it and how to do I fix it?

Code: [Select]


// main.cpp
//

#include <QFile>
#include "Snd.h"

int main(int argc, char *argv[])
{
    QFile file("test.wav");
    if (file.open(QIODevice::ReadOnly)) {
        qDebug("file opened\n");
        int size = file.size();
        char * buf = new char[size];;
        file.read(buf, size);

        char t[5];
        t[4] = 0;
        memcpy(t, buf, 4);
        qDebug("header: %s\n", t);

        CSnd snd;
        snd.Create(buf, size, QString("test"));
        snd.Play();

        delete [] buf;
    }

    return 0;
}




Code: [Select]

// Snd.h : header file
//
#ifndef _SND_H
#define _SND_H

#include <QtGui/QApplication>
#include <SFML/Audio.hpp>

/////////////////////////////////////////////////////////////////////////////
// CSnd

class CSnd
{
    // Construction
public:
    CSnd();

    // Attributes
public:
    bool IsValid () {
        return m_buffer && m_sound;
    }
    QString GetName() const;

    // Operations
public:
    void SetName (const QString);
    bool Create(const char *, int, const QString );
    bool Play ();
    bool Stop ();
    void RemoveAt (int n);

    // Implementation
public:
    ~CSnd();

protected:

    sf::SoundBuffer *m_buffer;
    sf::Sound *m_sound;

    QString m_name;
};

/////////////////////////////////////////////////////////////////////////////

#endif



Code: [Select]

// Snd.cpp : implementation file
//

#include "Snd.h"
#define q2c(__qstring__) (char*) __qstring__.toAscii().constData()

/////////////////////////////////////////////////////////////////////////////
// CSnd

CSnd::CSnd()
{

    m_buffer = NULL;
    m_sound = NULL;

}

CSnd::~CSnd()
{

    if (m_buffer) {
        delete m_buffer;
    }

    if (m_sound) {
        delete m_sound;
    }

}

/////////////////////////////////////////////////////////////////////////////
// CSnd message handlers

bool CSnd::Play ()
{
    if (IsValid() == FALSE) {
        // qDebug ("Warning - Cannot play from an invalid CSnd object '%s'\n",  q2c(m_name));
        return false;
    }

    sf::Sound::Status status = m_sound->GetStatus();
    if (status !=   sf::Sound::Playing ) {
        m_sound->Play();
        return true;
    }

    return true;
}

bool CSnd::Stop ()
{
    return false;
}


bool CSnd::Create(const char *buffer, int size, const QString name)
{
    if (!size) return true;
    if (!buffer ){
        qDebug("buffer is null\n");
    }

    m_sound = new sf::Sound;
    m_buffer = new sf::SoundBuffer;

    if (!m_buffer->LoadFromMemory(buffer, size))
    {
        qDebug("couldn't create: %s\n", q2c(name));
        return false;
    }
    m_sound->SetBuffer(*m_buffer);
    m_name = name;

    return true;
}

QString CSnd::GetName() const
{
    return m_name;
}

void CSnd::SetName(const QString name)
{
    m_name = name;
}




Running OpenSuse 11.2. Latest stable release.

Regards.
Frank B.[/code]

Pages: [1]
anything