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

Pages: 1 ... 37 38 [39] 40
571
General / SFML Wont Run Properly
« on: January 06, 2011, 06:59:08 pm »
And you really aren't impatient..

What machine are you running on? What OS? Give more information please.
The code looks like ok to me..

572
Graphics / size of view different from size of window
« on: January 06, 2011, 06:12:24 pm »
You should really read more about OpenGL or General Graphics. Check what a Orthographic projection is : )

Your view will be the amount of the world you want to see in your screen, a rectangle..

If you want really independent screens within your screen, use render targets, or scissor test, or even multiple viewports.

But for an interface, its way simpler:

One sf::View for the world position and another sf::View for the default screen(normally equals the resolution)

Activate WorldView
-> Draw World
Activate DefaultView
-> Draw Interface

Because you render the interface relative to the origin (0,0) of the world, you activate the defaultview, so you get it rendered always the same independtly from where your world view is in the moment : )

All the change you make is into worldview, to pan and zoom, to see different objects, easy enough : )

Notice this way the views always fit the screen, its normal : )

Hope it helps

573
Graphics / size of view different from size of window
« on: January 05, 2011, 03:28:52 pm »
The view is basicly the range of pixels you want to fit into your viewport.

If your view equals the viewport(in your case, whole window), there is no apparent scale, and the ratio will look good, but when you try to make a view different from the viewport, you will obvious get stretching or shrinking. Views are great for zoom and panning features for games.

If you don't want any resizing, you should only offset your current view, move it(panning) by a few pixels, but don't change its Width or Height. If this is not what you're looking for, probably neither are Views.

Imagine you have a screen with 1024x768 resolution.
If you make a view of 10x768, you are trying to fit a tiny 10-pixel-width column into the whole window, so you'll get major stretching, up to the point it's unrecognizable ;D

Correct me if i'm wrong : )

574
Graphics / Mixing shaders
« on: January 05, 2011, 03:15:46 pm »
In theory, if you draw the same image with different shaders, it will be drawing each time on top of the previous, so, only the last shader effect will be seen.

Isn't this right for this case?

As far as i know, when dealing with multiple shader effects for the same renderization, people composite the shader code, so all effects are programmed in the same shader. This is done programmaticly or mannualy,

Is this right? :)

575
General / [Solved] Resource Manager
« on: January 05, 2011, 04:05:46 am »
You would get more feedback if you make a thread only for your game in SFML Projects : )

576
General / [Solved] Resource Manager
« on: January 05, 2011, 03:56:00 am »
Keep going! and keep posting news on your project :D

577
General / [Solved] Resource Manager
« on: January 05, 2011, 12:39:11 am »
Every directory contains two special files, which happen to be directories too!

.  is Itself (Current Directory)
.. is Parent Directory

if you do c:\Games\..\ you end up in C:\

if you do c:\Games\.\.\.\.\.\ you always end up in c:\Games\

if you do c:\Games\Crazy\..\Crazy2\.\..\ you end up in c:\Games\
being Crazy and Crazy2 subdirectories of Games

Hope it clarifies everything : )

578
General / [Solved] Resource Manager
« on: January 05, 2011, 12:08:29 am »
Code: [Select]
std::string Directory = dir;
Directory += "\\*.*";
FindHandle = FindFirstFileA(Directory.c_str(), &File);


It's as simple as that, my mistake : )
the string member function c_str() will return it as const char * !

579
General / SFML2 Topic Request
« on: January 05, 2011, 12:06:26 am »
Good idea! That should do, i would like to have an idea of what's going on! that way i might even change sooner or later to SFML 2 : )

SFML2 looks hot! :D

580
Graphics / use shapes in vector
« on: January 04, 2011, 11:24:56 pm »
Change from

Code: [Select]
circle->sf::Shape::Circle(100, 50, 50, sf::Color::Red);

to

 
Code: [Select]
circle->circle = sf::Shape::Circle(100, 50, 50, sf::Color::Red);

You will need to make the member sf::Shape circle a PUBLIC member for this code.

I still don't agree with your class design  :) But thats just me, lets see someone else's angle of it : )

581
General / SFML2 Topic Request
« on: January 04, 2011, 11:09:02 pm »
Hey,

I'm posting to ask you, Laurent,if you can make something like a sticky topic, where you mantain a list with everything you add to SFML2!

I currently use 1.6 for its stability and release state. Im really interested in changing to SFML2 as soon as possible, canĀ“t wait to use all its features with my engine!

I didn't change yet because SFML2 may be susceptible to design changes and major additions, what could lead into a few rewriting of the engine later.

Would be nice to know about everything that is being added in SFML2, relative to SFML 1.6 along with any bugs it currently has : )

Thanks

582
Graphics / use shapes in vector
« on: January 04, 2011, 10:49:22 pm »
circles.push_back(new Circle());

The new Circle object already contains a sf::Shape as a private member, even though it doesn't have an actual Circle associated with it.

I don't know your goal with that, but you should rethink your design, a lot of weird things there :P

583
General / [Solved] Resource Manager
« on: January 04, 2011, 09:50:15 pm »
No, i don't think it will work, you are kinda hardcoding the number of images, you dont need to.

There is a way that you load ALL the images in there, no matter the format, i'll try to describe it, but notice you must be careful as you might end trying to load another file type into sf::Image. Make sure there are only images in the directory you're selecting : )

About the sprites, you shouldn't do what you are doing, you are creating one sprite per image, instead , store only the images and no sprites.
And in the game, whenever you need the sprite you create it, or even create them all at initialization, just associate the sprites with images when you need the sprites, not on image loading time, this way you can use the same image for many sprites, and save resources : )

Write a function like this:

Code: [Select]
void ResourceManager::LoadImages(string Directory){
     WIN32_FIND_DATAA File; //Info about the file to read
     HANDLE FindHandle = INVALID_HANDLE_VALUE; //Handle to find files
     FindHandle = FindFirstFileA(string(Directory + "\\*.*")), &File); //find the first file in the directory(parameter 1) and store in file(parameter 2)

     if(FindHandle == INVALID_HANDLE_VALUE)
  return; //return because there was NO first file

     //By now, you have the first file
     string FileName = File.cFileName;
     //You HAVE to make sure it is a valid file, because the special directories "." and ".." may appear!
     //In case you obtained a good file, load it :)
     //Also, directories will be counted as files! so, they will appear!
     //No subfolders where you are reading : )
     
     if(FileName != "." && FileName != ".."){
        sf::Image img;
        img.LoadFromFile(FileName);
        ImageList.insert(ImageList.end(), &img);
     }

    //For the rest of files
    while(FindNextFileA(FindHandle, &File)){
FileName = FileData.cFileName;
        //Same verifications as the first file, and then load, pretty much the same
    }
     //Close handles
     FindClose(FindHandle);

}


Finish the function by yourself, make sure you understand, even try to make it more powerful, by googling and exploring more properties!

Hint: try to make it recursive if you need it : )

584
General / [Solved] Resource Manager
« on: January 03, 2011, 06:16:37 pm »
Thats absolutely true! You should never skip that : )

Read and Learn a lot about everything related to gamedev until you have some confidence in your skills, then make games, and remember, start small.

But if you have time to spend in your self-taught education, i encourage you to prototype your RTS, then you will know what you need to learn from your failures!

Best of luck ;D

585
General / [Solved] Resource Manager
« on: January 03, 2011, 05:26:23 am »
Sure, implement a function that can load the images present in a whole folder! : )

http://msdn.microsoft.com/en-us/library/aa365200(VS.85).aspx

Check if that helps : ) Good night!

Pages: 1 ... 37 38 [39] 40
anything