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

Pages: 1 [2] 3
16
General / System Requirements of a Finished Game
« on: July 01, 2010, 05:54:28 pm »
Just try your application on a variety of computers. It's the only way.

There is no requirement for an SFML app because it depends how much you are drawing / what else you are doing.

17
Recently when making This I had to write my own line drawing function because I was unable to draw to an sf::Image.

Being able to draw to sf::Image would be a serious improvement I feel, it would definitely be an improvement to SFML. In fact I found it quite strange that I couldn't draw to an sf::Image.

Thanks.

18
http://jallenbah.co.uk/mousetracker.php
^ There's the page on my site for it.

It basically gets your mouse position using the Win API function GetMousePos() and adds a line to the image every 1/45th of a second between your current point and last point. The results can be both artistic and interesting.

Click for screen:
http://i48.tinypic.com/245im8j.jpg
(linked instead of tagged because it's 1280x1024)

19
General / Image::LoadFromPixels() - Don't understand.
« on: June 29, 2010, 06:01:29 pm »
That's precisely what I needed, thanks :D

20
General / Image::LoadFromPixels() - Don't understand.
« on: June 29, 2010, 04:30:13 pm »
Hello. I'm accessing pixel data directly but just doing image.SetPixel() is too slow. I read a while back that it's faster to simply work on my own array and then use Image::LoadFromPixels().

The problem with this is I can't seem to figure out how to get my pixel data from my image (Image::GetPixelsPtr() looks like what I want but ???), into a workable array, and then back into my image...

So how do I do this?
I'm using SFML 1.6

Thanks.

21
SFML projects / CppPaddle
« on: June 27, 2010, 06:29:48 pm »
The AI is not extremely difficult, it is impossible.

paddleYpos = ballYpos means you can never score.

22
SFML projects / Fancy Pong Game
« on: June 27, 2010, 06:25:03 pm »
Hello.

I recently made a slightly different game of pong, I wanted to make a simple game and make it really polished, since it's almost impossible for one person to make something really complex also really good.

So anyway, this game of mine has a fancy menu, scores system, pausing and such.

Screens, Video, Info and Download here:
http://jallenbah.co.uk/pong.php

23
General / Trouble getting SFML working with my Win32 window.
« on: February 05, 2010, 08:43:03 pm »
Hmm, is it possible for my SFML view on my win32 window to get events via this interface?
Code: [Select]
const sf::Input& input = renderpanel->GetInput();

24
General / Trouble getting SFML working with my Win32 window.
« on: February 05, 2010, 08:16:16 pm »
Oh man I feel so stupid, how could I have missed that D:

Thanks so much, and sorry about labelling it a bug based on my sillyness :P

25
General / Trouble getting SFML working with my Win32 window.
« on: February 05, 2010, 06:44:21 pm »
OK, SFML BUG IDENTIFIED
You appear to be using the width and height where you should be using x and y and using x and y where you should be using width and height.

Ok no bug afterall

26
General / Trouble getting SFML working with my Win32 window.
« on: February 05, 2010, 06:35:36 pm »
Strangely it draws from 0, 0 to 864, 600...

That is most confusing considering the definition of CreateWindowW is as so...
Code: [Select]
CreateWindowW(lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)
Which should mean that based on this...
Code: [Select]
SfmlControlPanel = CreateWindowW(L"STATIC", NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS,
864, 0, 160, 600, hWnd, NULL, hInstance, NULL);

that the following should be true in my function call:
Code: [Select]
lpClassName = "STATIC"
lpWindowName = NULL
dwStyle = WS_CHILD | WS_VISIBLE | QS_CLIPSIBLINGS
x = 864
y = 0
nWidth = 160
nHeight = 600
hWndParent = hWnd
hMenu = NULL
hInstance = hInstance
lpParam = NULL

Surely then the sfml render panel should range from 864, 0 to 864+160, 0+600 in my window?...


Ok this is getting REALLY wierd.
Code: [Select]
SfmlControlPanel = CreateWindowW(L"STATIC", NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS,
100, 0, 160, 600, hWnd, NULL, hInstance, NULL);

That does this:

It's like it's occupying the inverse of the areas specified, VERY peculiar.
Possible sfml bug bug?

27
General / Trouble getting SFML working with my Win32 window.
« on: February 05, 2010, 05:37:47 pm »
I used the DX9 renderer in Irrlicht, it works very similar to SFML with win32 integration.

Here are my viewport files.

Header
Code: [Select]
#ifndef Viewport_h
#define Viewport_h

#include <windows.h>
#include <irrlicht.h>

class Viewport
{
public:
Viewport(HWND hWnd, HINSTANCE hInstance);
~Viewport();

void Run();

protected:
HWND irrlichtViewport;
irr::IrrlichtDevice* device;
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
};

#endif


Source File
Code: [Select]
#include "Viewport.h"

Viewport::Viewport(HWND hWnd, HINSTANCE hInstance)
{
irrlichtViewport = CreateWindowW(L"STATIC", NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS,
0, 0, 864, 600, hWnd, NULL, hInstance, NULL);

irr::SIrrlichtCreationParameters params;
params.DriverType = irr::video::EDT_DIRECT3D9;
params.WindowId = reinterpret_cast<void*>(irrlichtViewport);

device = irr::createDeviceEx(params);

driver = device->getVideoDriver();
smgr = device->getSceneManager();

smgr->addCameraSceneNode(0, irr::core::vector3df(5,5,5),irr::core::vector3df(0,0,0));
irr::scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../Media/floortile.obj"));
node->setMaterialFlag(irr::video::EMF_LIGHTING, false);

}

Viewport::~Viewport()
{
device->closeDevice();
device->drop();
}

void Viewport::Run()
{
device->getTimer()->tick();
driver->beginScene(true, true, irr::video::SColor(255, 50, 50, 50));
smgr->drawAll();
driver->endScene();
}

28
General / Trouble getting SFML working with my Win32 window.
« on: February 05, 2010, 05:23:34 pm »
Ok, I am making an editor for my game using SFML to display the GUI and Irrlicht to display the viewport. My problem is that the SFML part isn't working at all, it should be in that little light patch on the right (it's light because thats the window colour, sfml is literally not displaying at all, not even a blank colour)


This is my WinMain
Code: [Select]
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
HWND hWnd = InitialiseWin32Window(hInstance);
Viewport* viewport = new Viewport(hWnd, hInstance);
ControlPanel* controlpanel = new ControlPanel(hWnd, hInstance);

MSG msg;
while(true)
{
if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
if(msg.message == WM_QUIT)
break;
}
viewport->Run();
controlpanel->Run();
Sleep(0);
}
delete controlpanel;
delete viewport;
return 0;
}


Control Panel header
Code: [Select]
#ifndef ControlPanel_h
#define ControlPanel_h

#include <windows.h>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>

class ControlPanel
{
public:
ControlPanel(HWND hWnd, HINSTANCE hInstance);
~ControlPanel();

void Run();

protected:
HWND SfmlControlPanel;
sf::RenderWindow* renderpanel;
};

#endif


And Control Panel source file
Code: [Select]
#include "ControlPanel.h"

ControlPanel::ControlPanel(HWND hWnd, HINSTANCE hInstance)
{
SfmlControlPanel = CreateWindowW(L"STATIC", NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS,
864, 0, 160, 600, hWnd, NULL, hInstance, NULL);
renderpanel = new sf::RenderWindow(hWnd);
}

ControlPanel::~ControlPanel()
{
delete renderpanel;
}

void ControlPanel::Run()
{
renderpanel->Clear(sf::Color(255,0,0));
renderpanel->Display();
}


I really have no idea why it's not working, as you can see I am trying to display that entire rectangle as red and nothing is displaying at all.
As you can see irrlicht is working correctly, so it shouldn't be a problem with my main window.

Thanks

29
General / Best way to set and get the values of individual pixels?
« on: January 22, 2010, 02:22:28 pm »
Right ok cool, thats the information I needed.
Thanks :D

30
General / Best way to set and get the values of individual pixels?
« on: January 22, 2010, 01:06:15 pm »
Hello.

I've been using SFML for some time now but I'd like a way to start making things like ray tracers and other things which are made by manually accessing and setting the values of pixels in the window.

So really what I want is something like
Code: [Select]
sf::Color GetPixel(int x, int y);
And
Code: [Select]
void SetPixel(int x, int y, sf::Color colour);

Is there anything like that?
Many thanks in advance.

Pages: 1 [2] 3
anything