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

Pages: 1 [2]
16
Graphics / Large RenderTexture class
« on: March 18, 2012, 03:09:23 am »
Quote from: "Mjonir"

Mind telling us that awesome technique you thought of? I'm curious now :P


No awesome techniques here, just using a view applied to a RenderTexture to handle the transformations.  This entire thread was due to my own over thinking and manually performing unnecessary math that SFML innately handles.

17
Graphics / Large RenderTexture class
« on: March 17, 2012, 11:24:20 pm »
Just wanted to update, with some quick application of the views to the renderTextures I use, I can effectively make the "big" renderTextures I was talking about pretty easily.  Some minor quarks I need to work out, but wow, I feel pretty dumb.  Not to mention I've been doing my own transformations this entire time.  My brain chemistry is just not geared towards the common sense, I guess.  Probably why I'm a student physicist.  I appreciate the help, and apologize for taking time on such a simple matter.

18
Graphics / Large RenderTexture class
« on: March 17, 2012, 10:28:47 pm »
Oh boy, I am brain-dead.  I use views for the RenderWindow that I draw everything to, but not the individual RenderTextures.  I've been applying transformations to the RenderWindow.  I'm not entirely sure if applying them individually to the RenderTextures will solve my problem, but churning through my brain it sounds like it will.  

I'll post an update on this if it works and what I did.  Thanks Laurent.

19
Graphics / Moving one shape over another using the mouse
« on: March 17, 2012, 07:25:34 am »
Quote from: "Kiblinix"
For some reason adding that second part in the else condition causes me to not be able to drag the circles (Reason which is unknown to me :P)

I can click on a part of the circle and it moves slightly, but no dragging.


Just look through the logic step by step.  The reason it disabled dragging was because it no longer updates the movement until you release the mouse key.  All you need to do is make it so it remembers which shape you're dragging (with a pointer, or integer indexing, or something) and just update the position every frame.  

If I was to do it, I would just have a pointer pointing to the object.  When you have the mouse down, if the pointer is NULL, set it to the objects address.  Every frame, if the mouse is still down and the pointer is not NULL, update that objects position.  When the mouse is release, if the pointer has an address assigned to it, set it to NULL.

20
Graphics / Moving one shape over another using the mouse
« on: March 17, 2012, 12:28:46 am »
There are a few problems I can see.

First, define your nodeGrabbed only 1 time.  Either put it in a class, then set its initial value in the constructor, or put it at the very beginning of your program before you execute the main loop.  

You also need to add more conditions to the "else."

In the else condition, just add:

if (!(sf::Mouse::IsButtonPressed(sf::Mouse::Button::Left))) {

nodeGrabbed = false;

}

Those changes should make what you're trying to do work properly.

21
Graphics / Large RenderTexture class
« on: March 17, 2012, 12:18:17 am »
I created an implementation of the concept I devised here.  To my dismay, it is much too slow to be workable in the context I am using it for.

So, I find myself needing some help coming up with an alternative, if possible.

The reason I am not able to use vertex arrays, beyond my brain not liking them, is because I have several different textures in use, possibly more than several (20+).  They are high-res textures, so making 1 big texture is really not an option.  Some of the textures are also procedurally generated, and the individual sprites being drawn do not have uniform transformations.

So, frankly, I find myself somewhat stuck without the possibility of using a single large texture.  I mean...the renderTexture size I need, at a minimum, is 1024x1024.  If a graphics card only supports 512x512 (I realize that would be a crazy old card...going for large compatibility), that means nothing is drawn, and I need to find a way around that.  

Any assistance is greatly appreciated.

22
Graphics / Large RenderTexture class
« on: March 15, 2012, 11:41:01 pm »
Oh I know they can't be self contained, but, frankly, I've come to understand how these work and vertex arrays don't agree with my brain.  My system is also already built around the premise of using renderTextures, so it would be terribly time consuming to convert it to a different drawing concept.  I figure the class can compute which texture to draw a sprite to based upon the position relatively easy, and I can simply loop through all the textures and render each texture individually using normal sprites.

Thank you for the assistance.

23
Graphics / Large RenderTexture class
« on: March 15, 2012, 11:25:54 pm »
Quote from: "Laurent"
As far as I know, nobody has written such a class yet.

Out of curiosity, why do you need large render-textures?


I've created a rather complex system built upon RenderTextures.  I'm drawing thousands of sprites to currently 1 large RenderTexture. The reason I need it to be so large is due to scaling and rotations.  I want to be able to scale and rotate without performing transformations on the coordinates used by the individual sprites I draw to the textures.  I'm using about 4 different coordinate systems and it's hard enough to manage as is.

I originally thought RenderTextures operated the same way a view operates.  Had I know about the texture limit when I was creating my framework a few months ago, I would have opted for another option.  That said, given the purpose RenderTextures serve, I believe this would be a useful thing to make, so I suppose I will go ahead and code it unless there is a better alternative.

24
Graphics / Key Released?
« on: March 15, 2012, 11:10:08 pm »
If you're trying to get asynchronous input, use, for example:
"sf::Keyboard::IsKeyPressed(sf::Keyboard::A)"

As for the event keypresses, it detects when a key is pressed, I imagine it sets an internal flag saying the key is pressed, then will not trigger again until the key is released, the flag reset, and key pressed again.  So you really don't need to do any input management yourself.

25
Graphics / Key Released?
« on: March 15, 2012, 10:52:42 pm »
Look in the tutorials for 1.6 or whatever.  It's pretty easy to deduce any changes and figure it all out, there really isn't much/if any modified from 1.6 to 2.0 in way of input.

26
Graphics / Large RenderTexture class
« on: March 15, 2012, 10:50:39 pm »
Hello,

I was wondering if any in this community have developed a class to handle renderTextures beyond a graphics card texture limit that uses the same getters and setters as the original class.  I was about to begin my own work on this, but I figured this is probably something another has done so there is no harm in checking.  

Basically, I see this Large RenderTexture class as having all the same methods as the original RenderTexture, the only difference being it will automatically handle sub-dividing into an appropriate number of textures in order to stay at or below the maximum texture size for a graphics card.  As for getting the texture and drawing it, could just keep track of the offset per sub-texture and set a sprites position to that offset when trying to use it.  Anyway, has anyone done this or something similar?  Did I search and couldn't find anything, save the "Thor" library which deals with textures themselves, not renderTextures.

Thanks.

Pages: 1 [2]
anything