Search found 387 matches

by qpHalcy0n
Thu Mar 25, 2010 2:10 pm
Forum: Programming Discussion
Topic: [SOLVED][SDL] Rotating a specific area of a surface
Replies: 22
Views: 1824

Re: [SDL] Rotating a specific area of a surface

What I'm trying to do is get you to really think the problem though. I'm not a huge fan of simply posting a function and saying "Here ya go....this works". That plug and play approach doesn't get anyone learning anything....."but whatever". I think if you'll look at some of the d...
by qpHalcy0n
Thu Mar 25, 2010 1:51 pm
Forum: Programming Discussion
Topic: [SOLVED][SDL] Rotating a specific area of a surface
Replies: 22
Views: 1824

Re: [SDL] Rotating a specific area of a surface

The first step is to not take offense. I'm simply telling you how that function probably will not work. That is all....no more, no less. If you're going to solve your problem you need to take a constructive attitude towards it and perhaps see it from a different perspective. What we're SAYING is tha...
by qpHalcy0n
Thu Mar 25, 2010 1:01 pm
Forum: Programming Discussion
Topic: [SOLVED][SDL] Rotating a specific area of a surface
Replies: 22
Views: 1824

Re: [SDL] Rotating a specific area of a surface

Mkay, then you've got a few design considerations to take into.....consideration... :\ If you want to add the rotated tile BACK into the original sprite sheet, you're looking at reallocating the space for it and offsetting every subsequent tile in the new sheet. The other option is to just put it ba...
by qpHalcy0n
Thu Mar 25, 2010 12:10 pm
Forum: Programming Discussion
Topic: [SOLVED][SDL] Rotating a specific area of a surface
Replies: 22
Views: 1824

Re: [SDL] Rotating a specific area of a surface

I think your clarification of what you're looking for just made me more confused :] This may look fine for a 90 degree rotation, but if you rotate a tile 13.3 degrees, then it's going to look like hell (void space and overlap) This should be a trivial problem if we just know EXACTLY what you're look...
by qpHalcy0n
Wed Mar 24, 2010 9:19 pm
Forum: Programming Discussion
Topic: [SOLVED][SDL] Rotating a specific area of a surface
Replies: 22
Views: 1824

Re: [SDL] Rotating a specific area of a surface

Having a hard time understanding what EXACTLY you're looking for here. I have an idea, but if you rotate tiles and then stamp them back down you're gonna have some really nasty holes there.

Either way, that function at a glance looks to be extraordinarily inefficient.
by qpHalcy0n
Wed Mar 24, 2010 2:30 pm
Forum: Programming Discussion
Topic: Inserting a space in function calls/definitions
Replies: 20
Views: 1373

Re: Inserting a space in function calls/definitions

#include <stdio.h> int main(void) { for(int /* declaring integer var */ a /* naming said var "a" */ = 0 /* setting "a" to = 0 */ ; /* use var "a" as LVALUE */ a /* if LVALUE */ < /* is less than */ 10 /* the integer value 10 */ ; a++ /* add 1 to var "a" */) {...
by qpHalcy0n
Mon Mar 22, 2010 5:53 pm
Forum: Programming Discussion
Topic: C++ Pointer/HEAP Question
Replies: 16
Views: 1515

Re: C++ Pointer/HEAP Question

Most implementations (including STL implementations...which are very fast) of heap allocated memory must search the heap for available memory when allocating and reduce fragmentation (at best) when de-allocating memory. I am very sure that this is managed by the OS. Unfortunately this is not the ca...
by qpHalcy0n
Mon Mar 22, 2010 12:36 pm
Forum: Programming Discussion
Topic: C++ Pointer/HEAP Question
Replies: 16
Views: 1515

Re: C++ Pointer/HEAP Question

If we're gonna expound on this one, then I'd say that for sure....the answer is not always quite as simple. What heap allocation tells a programmer MORE is the expected persistence of the object. So, if I see heap allocations, I tend to believe that object persists beyond the scope of its allocation...
by qpHalcy0n
Sat Mar 13, 2010 9:28 am
Forum: Programming Discussion
Topic: Set OpenGL color key??
Replies: 15
Views: 3856

Re: Set OpenGL color key??

Unfortunately OpenGL does not natively support color keying. What you would be forced to do is reallocate space for the extra byte (alpha...assuming your texture is 3 bytes per pixel). Loop through the pixels and if the incoming pixel color matches the key, you can pack 0 into the alpha channel, 255...
by qpHalcy0n
Fri Mar 12, 2010 1:02 am
Forum: Programming Discussion
Topic: [SOLVED] Help! Reading in binary file C++
Replies: 4
Views: 621

Re: Help! Reading in binary file C++

Usually with those kinds of formats, the preliminary information you've got there will be packed in a header. The C-style file i/o "fread" will automatically set the file pointer to += however many bytes you just read. Generally, everything after the magic sum can be packed into a file hea...
by qpHalcy0n
Sun Feb 28, 2010 5:48 pm
Forum: Programming Discussion
Topic: Points/Vectors/Rectangles
Replies: 18
Views: 1287

Re: Points/Vectors/Rectangles

In theoretical mathematics this is the case. However, analytic geometry is definitely a discrete form of math for which there are most certainly definitions, in which case the definition of the vector becomes that which was described at length in the post. In terms of computer graphics which works w...
by qpHalcy0n
Sun Feb 28, 2010 5:08 pm
Forum: Programming Discussion
Topic: Points/Vectors/Rectangles
Replies: 18
Views: 1287

Re: Points/Vectors/Rectangles

...that is correct, but the key here is "in VECTOR space". There are multiple definitions of a vector. This particular definition demands that the definition be in a "vector space" which is "defined by vectors". That is that the elements can be scaled added and multipli...
by qpHalcy0n
Sun Feb 28, 2010 4:33 pm
Forum: Programming Discussion
Topic: Points/Vectors/Rectangles
Replies: 18
Views: 1287

Re: Points/Vectors/Rectangles

Lord no. The differences between points and vectors are HUGE. As I've said, they're represented the same way. However the operations performed between then *ARE NOT* the same. It's important to abstract them because of what they mean, especially in terms of graphics. Again, Points have location. No ...
by qpHalcy0n
Sat Feb 27, 2010 2:40 pm
Forum: Programming Discussion
Topic: [SOLVED]2D array assignment(C++)
Replies: 8
Views: 537

Re: 2D array assignment(C++)

You probably would not want to calloc. You'd want to memset in this case.
by qpHalcy0n
Tue Feb 23, 2010 8:57 pm
Forum: Programming Discussion
Topic: C# Question: XNA or SDL.NET?
Replies: 13
Views: 2475

Re: C# Question: XNA or SDL.NET?

@Gyro I know that you're really interested in taking a fine grained level of control. The shader pipeline of XNA would be the perfect match for you, then. Quite literally writing a shader reconfigures the graphics hardware (to some extent) which is actually an extremely simple architecture. Some peo...