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 - Mars_999

Pages: 1 2 [3] 4 5 ... 7
31
General / Bug with picking and window mode?
« on: May 29, 2012, 06:29:33 am »
I am doing ray picking in a window mode and I can't get a correct result, if I run fullscreen then I get correct results? From what I can tell in window mode the Z value returned is the far plane?

32
General / Re: Mouse Drag Box tutorial with SFML?
« on: May 26, 2012, 05:43:12 pm »
I am thinking more of a RTS type box, where I click and drag and draw a box with lines to select units... in the box... but now I think about it, both situations would be nice to see.

1. Click drag box to select units
2. Click on unit to drag it around like you said...


33
General / Mouse Drag Box tutorial with SFML?
« on: May 26, 2012, 05:23:46 pm »
Anyone have a tutorial on doing a mouse drag box with SFML? I don't remember seeing one, and find it hard to believe their hasn't been any desires to see one...

Thanks!

34
General discussions / Re: sf::Keyboard::isKeyPressed()
« on: May 05, 2012, 03:38:15 am »
Kind of what I figured I needed something that was triggered when an action happened vs. constantly updating each loop....

Thanks I will give it a go.

35
General discussions / Re: sf::Keyboard::isKeyPressed()
« on: May 05, 2012, 01:20:56 am »
My wild guess would be that isKeyPressed returns true as long as the key is pressed, and therefore SetMoveFwd is called numerous times till you release the key again (let's assume this happens in a (game) loop). That would result in a kinda random state of whatever SetMoveFwd changes (constantly switching from true to false and so on), unless you're not showing everything.

It's just a guess though.

that is my guess also but what to do about it?

36
General discussions / sf::Keyboard::isKeyPressed()
« on: May 05, 2012, 12:04:21 am »
I am trying to use the space bar to allow user to move forward until they hit it again, but I am not having any luck with it. The problem I am sure is the logic, but can't figure out how else to do it...

if(sf::Keyboard::isKeyPressed(sf::Keyboard::Space))
SetMoveFwd(!IsMoveFwd());

Thanks!

BTW SFML2.0

37
General discussions / Re: Camera class?
« on: May 01, 2012, 03:24:10 am »
Yes I see it's my bad for assuming everyone would assume I was working in 3D.... Anyway thanks for all the help. I will look around. Was hoping someone had a lib for this as their is one for everything else under the sun....

38
General discussions / Re: Camera class?
« on: May 01, 2012, 01:31:32 am »
How is sf::View supposed to work with 3D? It's says it is only for 2D.... or are you meaning make a class like it...

39
General discussions / Camera class?
« on: April 30, 2012, 06:19:07 am »
Anyone here made a camera lib that works with OpenGL to use with SFML or Thor? that is allows 1st,3rd, free roam, ect... style of cameras to be used?

And has other functionality such as follow object, turn over time ect....

Thanks!

40
Thanks.

I was unsure, and I only hope the GLEW version you use vs. one I would use in my projects doesn't cause any issues... That's all. Since I am sure I will be using a newer version....

41
General discussions / GLEW and not exporting the GLEW symbols in SFML
« on: April 15, 2012, 08:44:22 am »
I have to ask why this isn't possible.... With some many great projects using SFML, seems almost insane that one can't access GLEW to keep external libs to a minimum while using this great lib....

I asked SFGUI why they used GLEE which is dead... and the answer is here

http://sfgui.sfml-dev.de/forum/topic87-glee-vs-glew.html

and since SFML is using GLEW and so do I, why do I need to include it again in my project...

Please explain this insanity.... Thanks!

42
General discussions / sf::Thread and know if it's running?
« on: April 10, 2012, 01:21:35 am »
I am going to guess the answer is this....

If I have a sf::Thread running how can I check if it's still active with sf::Thread?

I don't see anything in the docs to do

thread.isActive();

so I am guessing here that I would need to make a bool variable or something in that thread and check it from another thread to see if that function is still running?

Thanks...

43
Network / sf::Packet and std::string space causes to break text up?
« on: April 09, 2012, 01:05:58 am »
I am not sure why, but if I take input and send it as a packet with a space in the string, the packet only sends data up to the space and breaks off the rest of the string?

Any ideas?

Thanks!

SFML2.0 and VS2010

44
Network / Re: simple client
« on: April 09, 2012, 01:03:00 am »
You can check out my tutorial in the wiki... It may help...

45
Can someone please post his code as a sticky for others to see? This code works for a very very simple client/server chat back and forth example I came up with, to show others after beating my head against the wall, I figured I would show others to help them with their first examples....

Code: [Select]
#include "stdafx.h"

const unsigned short PORT = 5000;
const std::string IPADDRESS("192.168.0.100");//change to suit your needs

std::string msgSend;

sf::TcpSocket socket;
sf::Mutex globalMutex;
bool quit = false;

void DoStuff(void)
{
static std::string oldMsg;
while(!quit)
{
sf::Packet packetSend;
globalMutex.lock();
packetSend << msgSend;
globalMutex.unlock();

socket.send(packetSend);

std::string msg;
sf::Packet packetReceive;

socket.receive(packetReceive);
if(packetReceive >> msg)
{
if(oldMsg != msg)
if(!msg.empty())
{
std::cout << msg << std::endl;
oldMsg = msg;
}
}
}
}
void Server(void)
{
sf::TcpListener listener;
listener.listen(PORT);
listener.accept(socket);
std::cout << "New client connected: " << socket.getRemoteAddress() << std::endl;
}
bool Client(void)
{
if(socket.connect(IPADDRESS, PORT) == sf::Socket::Done)
{
std::cout << "Connected\n";
return true;
}
return false;
}
void GetInput(void)
{
std::string s;
std::cout << "\nEnter \"exit\" to quit or message to send: ";
std::cin >> s;
if(s == "exit")
quit = true;
globalMutex.lock();
msgSend = s;
globalMutex.unlock();
}
int main(int argc, char* argv[])
{
sf::Thread* thread = 0;

char who;
    std::cout << "Do you want to be a server (s) or a client (c) ? ";
    std::cin  >> who;

    if(who == 's')
Server();
else
Client();

thread = new sf::Thread(&DoStuff);
thread->launch();

while(!quit)
{
GetInput();
}
if(thread)
{
thread->wait();
delete thread;
}
return 0;
}

Pages: 1 2 [3] 4 5 ... 7