Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


MarkS

Member Since 09 Jan 2001
Offline Last Active Today, 12:15 AM

#5213801 Methods for Drawing a Low-Resolution 2D Line Gradually?

Posted by MarkS on 01 March 2015 - 09:39 PM

You could render a 1-pixel thick line to a texture and then apply it to a quad of any size. I've never done render to texture, so I cannot help you there, but I've seen several tutorials online.


#5210877 Disassociate mouse with its position

Posted by MarkS on 15 February 2015 - 01:48 PM

Thanks again, also I think I will implement DInput.


Someone can correct me if I'm wrong, but I believe that DirectInput is depreciated. It's been a LONG time, so I may be thinking of something else.


#5210850 Disassociate mouse with its position

Posted by MarkS on 15 February 2015 - 09:44 AM

You could also use raw input instead of querying the cursor location. I haven't used that myself, but it should work well: https://msdn.microsoft.com/en-us/library/windows/desktop/ee418864%28v=vs.85%29.aspx.

NICE! I did not know that!




#5210843 Disassociate mouse with its position

Posted by MarkS on 15 February 2015 - 09:24 AM

As far as I know, what you want to do isn't possible directly with Windows; you have to cheat.

You can move the cursor back to the center, as haegarr mentioned, but I've always ran into trouble with that. I've never been able to implement that and not have the movements jerky. What I've done and what I've seen others do is to wrap the mouse once it reaches the edge of the screen using SetCursorPos.




#5206979 Some programmers actually hate OOP languages? WHAT?!

Posted by MarkS on 27 January 2015 - 01:43 PM

I didn't read the thread, but I hate OOP. I've been programming since I was 8. I started with Pascal, moved to BASIC of all things, and then to C and Assembly. I didn't touch C++ until about five years ago. To me, it is frustratingly difficult. I actually enjoyed programming before OOP. I wrote code, it worked, yay! Now the level of complexity has jumped so much to do the same things that it has taken all joy out of it for me. Programming and Game Programming was a hobby for me. However, the frequent headaches - literal, physical headaches - caused from trying to write correct C++, lead me to drop programming nearly altogether. I was going to write an article on a fast tile map rendering process I came up with, but I wrote it is C. I couldn't convert it to C++, and God help me if I dared write the article with straight C code, so I dropped it. I stopped game programming altogether soon after.

 

Now I'm focused on microcontroller-based projects. I can write code in whatever language the MCU's compiler supports without criticism. It has made some of the fun return. I've always enjoyed electronics, so I can do two hobbies at once.

OOP may have its benefits, but it is NOT necessary for good and functioning code. OOP, in and of itself, is not what irritates me, but rather, the people that trash those that do not use it. I don't use it. I don't need it. If you can read and understand my code, leave me alone.




#5085879 Merge Wavefront files

Posted by MarkS on 14 August 2013 - 12:13 PM

It could be as simple as opening both files in a text editor and copying one into the other. But that doesn't sound like what you want.

The OBJ format does allow for multiple meshes within one file, but that is rarely used in most importers. How is your importer written and what features can it support?

What exactly are you trying to do? If you are trying for a custom file format, I'd personally recommend that you skip OBJ and go another route.


#5085684 Question about dereferencing syntax in C/C++...

Posted by MarkS on 13 August 2013 - 04:48 PM

I'm always perplexed that this is seen as an issue.


It isn't so much of an issue as unnecessary. It is a distinction that doesn't seem to fulfill a need.


#5085673 Question about dereferencing syntax in C/C++...

Posted by MarkS on 13 August 2013 - 04:31 PM

I have always accepted how C/C++ dreferences structs and pointers to structs until a recent thread on a new language, C-UP. The developer stated that the language doesn't use the '->' operator to dereference pointers.

This makes a lot of sense. I'm curious why the C++ standard still requires the use of '->' and '*'?
 
struct foo{
int i;
int *j;
};
 
foo foo1,*foo2;
int temp;

// These next lines do the exact same thing...
foo1.i = 1;
foo2->i = 1;
temp = foo1.i;
temp = foo2->i;
temp = *foo1.j;
temp = *foo2->j;
The only reason I can see for the disparity is that '->' and '*' informs the reader that a pointer is being dereferenced. Does it truly matter? All that is being done is accessing a member of a class or struct.


#5082321 My OLD Syntax

Posted by MarkS on 01 August 2013 - 04:15 PM

Is that legal syntax? I tried that in VS 2012 and it yelled at me.




#5082222 List of C++11 compliant compilers?

Posted by MarkS on 01 August 2013 - 10:33 AM

I'm getting fed up with Visual Studio Express 2012. There are so many new language features that I can only look at in code samples.

 

Are there any *free* Windows-based C++11 compilers? What are some recommendations?




#5081254 "Standard" Resolution Performance

Posted by MarkS on 28 July 2013 - 01:05 PM

I apologize. I am not known for very eloquent speech. I should have written that as "...some in academia...". I know that not everyone is like that, but I've heard and read so many horror stories. I did not many any offense.

I still believe and stand behind my statement that this professor is stuck in the past. There was a time where he would have been correct, but that time ended about a decade ago. To teach this as current fact is puzzling at best.


#5081038 Jittery Movement and Uncontrollable Rotating

Posted by MarkS on 27 July 2013 - 03:47 PM

Keep track of the mouse position. If the new mouse position is viable, save it and use it to determine the rotation. If it is not viable, discard it and use the stored position to determine rotation.

 
I don't think you read the post or the code :/
I am already doing that.


No, you are tracking the rotation. Track the mouse position.

if fabs(old_pos - mouse_pos) > epsilon then
old_pos = mouse_pos
directionV = Normalize(mouse_pos- sp.Position);
else
directionV = Normalize(old_pos- sp.Position);
endif

newRot = (float)Math.Atan2(directionV.Y, directionV.X) * 180 / (float)Math.PI + 90;



#5081030 Jittery Movement and Uncontrollable Rotating

Posted by MarkS on 27 July 2013 - 03:27 PM

Think about it. When the mouse point is equal to the rotation point, exactly what orientation should the sprite have? A better way to look at it is this: Imagine a point in the exact center of your body. Now, orient yourself to face that point. The results from atan2 at this point are undefined.


#5080993 Rule of Three, and const-correctness questions

Posted by MarkS on 27 July 2013 - 12:31 PM

I looked at L. Spiro's link about the Rule of Two.

I'm confused about a couple of points. What is the purpose of the reset() and swap() functions? Reset deletes the pointer then assigns the incoming pointer to the deleted pointer! O.o How does that work and under what circumstances would I use swap?


#5080023 "Standard" Resolution Performance

Posted by MarkS on 23 July 2013 - 09:57 PM

Seriously, ask him what those "advanced graphics algorithms" are. Ask for names. Names of algorithms, names of researchers, names of books or other publications. If he "doesn't remember", ask him exactly what problems those algorithms solve. If you manage to get any answers, we'll look them up.


I would disagree. While I haven't been to college, I do know that those in academia do not like to be challenged and a professor can make your life a living hell. He is clearly stuck in the past on this issue. This is a time where you smile and nod. You gain nothing from challenging him and stand to lose a great deal.




PARTNERS