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.


Messages - Atomical

Pages: [1]
1
General discussions / Re: SFML 2 and its new website released
« on: April 30, 2013, 11:09:28 am »
I don't know how much this is relevant but freeglut 3.0 has Android support with OpenGL ES 2.0 http://freeglut.sourceforge.net/docs/android.php

The new design is so cleeaaan

2
General discussions / Re: What physics engine to use?
« on: April 18, 2013, 11:44:30 am »
Box2D is the way to go

3
Feature requests / Loopback recording for SFML
« on: February 06, 2012, 06:32:25 pm »
So after messing around with the BASS_WASAPI library I managed to get it working kinda.

Ideally I would have nothing to start with, and using sf::SoundRecorder I could select either an input channel to record from or an output channel to record from. You could get a list of active channels from GetChannelList()
The way it is now (I think) is that it records from the default active recording channel.

Then I would make a customized sf::SoundRecorder and draw graphics from the FFT data in OnProcessSamples().


This is for a plugin I'm making for a server in which the world shakes according to the bass on the song that plays on the server.

4
Feature requests / Loopback recording for SFML
« on: February 02, 2012, 03:03:31 pm »
I wish to make a graphical equalizer from the sound that is being played through my speakers and I notice that it is not possible to change the source of the audio.

It would be nice if you could do so.

5
General / SFML Linker error vs 2010
« on: January 11, 2012, 05:49:10 pm »
You forgot to link to the lib files?

6
General / Gameloops and timing, smooth rotation
« on: November 28, 2011, 07:05:44 pm »
try the built in window.SetFrameratelimit(FPS)

7
General / SFML 1.6 in visual C++ 2010
« on: November 28, 2011, 06:33:17 pm »
In the Linker -> Input section in your project properties you need to specify what libraries you're linking to

e.g

sfml-graphics.lib; sfml-window.lib; sfml-system.lib

You would know this if you actually went to the Tutorial page on the website instead of automatically giving up and starting to ask questions. Nor did you actually give us the linker errors you got so I'm just guessing that this is the problem you're experiencing.

http://sfml-dev.org/tutorials/1.6/start-vc.php

8
Graphics / Crash w/ VC++ 2010, SFML static libs and static sf::Texture?
« on: November 16, 2011, 04:54:29 pm »
Hello, are you by any chance using the Intel HD graphics driver?

9
General / deleting sf::Texture* - I must be doing it really wrong
« on: October 31, 2011, 07:15:05 pm »
RenderTexture and Texture crashed on deletion because I was using Intel HD graphics driver due to my laptop forcing it on me(Or that's my solution, worked on my home computer and my friend's laptop). I'm currently installing the ATI drivers.

EDIT: Now it works.

10
General / deleting sf::Texture* - I must be doing it really wrong
« on: October 18, 2011, 07:56:19 pm »
I'm having the same problem as explained, in the visual studio 2010 ultimate debbuger it works fine.

It crashes on program exit.

Moving the declaration of sf::Texture from line 24 in the header file to just before line 59 in the cpp file, thus creating a new texture every time this component is drawn, will stop the program from crashing on exit. This makes my other components unable to get and work on the texture.

This is a temorary design thought, I'm going to do something similar to the OP, but that's unrelated to the issue.

Objsprite.h
Code: [Select]

#pragma once
#include "Component.h"
#include "Object.h"
#include <SFML/Graphics.hpp>
#include <string>
class PlayState;
class ObjSprite : public Component
{
public:
ObjSprite(Entity *entity, const std::string &name);
virtual ~ObjSprite();

static Component* Create(Entity* entity, const std::string &name) { return new ObjSprite(entity, name); }

void Init(PlayState *pState);
void Update();
void Draw(sf::RenderWindow& window);
void ExecuteCommand(int command, void* data = 0);
void ExecuteEvent(int event, void* data) {};
private:
bool compInitialized;
protected:
sf::Image spriteImage;
sf::Texture texture;
sf::Sprite sprite;

Property<std::string> imagePath;
Property<sf::Sprite*> spritePtr;

Property<float> posX;
Property<float> posY;

Property<float> imagePosX;
Property<float> imagePosY;

Property<float> spriteWidth;
Property<float> spriteHeight;

Property<float> rotation;

Property<bool> staticObject;

Object* go;

};


Objsprite.cpp
Code: [Select]


#include "ObjSprite.h"
#include <iostream>
#include <boost/bind.hpp>
#include "PlayState.h"
ObjSprite::ObjSprite(Entity *entity, const std::string &name)
: Component(entity,name), go((Object*)entity)
{
imagePath = go->AddProperty<std::string>("SpriteImage","sprites/default.bmp");

posX = go->AddProperty<float>("PosX",0);
posY = go->AddProperty<float>("PosY",0);

imagePosX = go->AddProperty<float>("ImagePosX",0);
imagePosY = go->AddProperty<float>("ImagePosY",0);

spriteWidth = go->AddProperty<float>("SpriteWidth",32);
spriteHeight = go->AddProperty<float>("SpriteHeight",32);

rotation = go->AddProperty<float>("Rotation",0);

staticObject = go->AddProperty<bool>("StaticObject",true);

compInitialized = false;
}

ObjSprite::~ObjSprite()
{

}

void ObjSprite::Init(PlayState *pState)
{
if(!compInitialized)
{
spriteImage.LoadFromFile(imagePath.Get());
spriteImage.CreateMaskFromColor(sf::Color(255,0,255));

sprite.SetSubRect(sf::IntRect(0,0,spriteWidth.Get(),spriteHeight.Get()));
sprite.SetPosition( posX.Get(),posY.Get() );

spritePtr = go->AddProperty<sf::Sprite*>("Sprite",&sprite);

compInitialized = true;
sprite.SetOrigin( spriteWidth.Get()/2,spriteHeight.Get()/2);
}
}

void ObjSprite::Update()
{
if(!staticObject.Get())
{
sprite.SetPosition( posX.Get(),posY.Get() );
sprite.SetRotation( rotation.Get() );
}
}

void ObjSprite::Draw(sf::RenderWindow &window)
{
texture.LoadFromImage(spriteImage);
sprite.SetTexture( texture,false );
window.Draw(sprite);
}

void ObjSprite::ExecuteCommand(int command, void* data )
{

}

11
General / better tutorial for SFML?
« on: August 29, 2011, 12:04:23 am »
Quote


1) At what point should i depart from console programs (becuz they are kind of boring), i can make small (very small) text games, somewhat know how to use classes, loops, etc.

When you can code freely without copy pasting code/modifying code. And when you understand classes very well with inheretance and public/private instancing.(when you understand object orientated programming)

Quote

2) SFML seems to have trouble explaining things well when going from console to SFML.

the 1.6 tutorial explains you very well how to set up SFML with your developer enviroment

Quote

3) i read through the tutorials on this site, and they are not very (console to SFML) friendly. I have to keep posting questions on Cplusplus forums due to most answers on the beginners forum are regarding console apps.
 
4) is there a tutorial for beginners starting SFML directly from console learning??? if so please reply

The tutorials are already easy enough.

Quote

5) what exactly can u use SFML for? 2D games, GUI programs(i guess meaning like a windows app) ( like menu selection for the game?). if you wanted to make 3D games, why could you not use SFML and just use their libraries for menus and make your own classes for the 3D?


http://sfml-dev.org/features.php
And you have no idea what you are talking about.

12
Network / Checking client ping
« on: August 24, 2011, 05:14:27 am »
Set timestamp
Send ping packet to client
client sends pong back
currenttime-timestamp

Pages: [1]