mouse values

Started by
35 comments, last by phil67rpg 10 years, 7 months ago

well I am now reading game programming 3rd edtion, by jonathan harbor.

Advertisement
I've just diffed the code with the available one from your old post (mind the date). You haven't changed a single character. If this isn't intentional trolling it sure is wasting the time of the people trying to help you.

I'm done here.

Edit: Please excuse. I'm hereby taking the "trolling" back.

But still: More effort is due.

why do people always accuse me of trolling

Phil, mellow.png

I might not be the perfect person to say this, but listen carefully.

These forums are not just for people to do the work for you, they will assist you on the long journey of development. Programming takes time, and yes, you may post an issue you have, but you could at least show that you've put some effort into your work.

The reason why unbird acted as he did (Yes, maybe it was harsh, but, as he did not see any effort put into the work, so he wasn't sure whether you were actually interested in doing some progress, which could just mean that he was wasting his time, people have their own life too. ), ok I pretty much just stated that in the backets... (Unbird, I am no mind reader [YET!], so please add if you feel like it!)

One other thing that I noticed, is that you jump a lot, in the other thread. First you were making a tic-tac-toe game, then suddenly because it was a bit hard, you wanted to make apps (which is fine!), but, then after you wanted to make a simple calculator, etc... One crucial thing is that you have to STICK to something!

I would advise you to look over all your code, double TRIPLE check it, then debug it in detail, not just where you think you're wrong, but from start to end.

We will all gladly assist you in the near future, but you have to show some effort! wacko.png

Good Luck.

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

I'm curious Phil, what is your current employment. You say you got a job using DX9?


I go with BearNutts: Use an easier framework. And maybe an easier language, too. (XNA, Löve, Pygame, take your pick).

It's Beernutts. Just a little correction ;)

Phil, ssn't it a little dishonest to truly take a job that your are fully unqualified for? Well, good job fooling someone into giving you that job (if you really did get hired). Get as much out of it as possible until they figure out the problems you have.

Did you sumbit a resume for this job? Did you have to answer technical questions? From what I know, I can't imagine you getting any questions right.

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

Getting back on subject....

No, those values do not represent the proper mouse coordinates. Check the documentation which says:

The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.

Remarks
Use the following code to obtain the horizontal and vertical position:
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);

Important Do not use the LOWORD or HIWORD macros to extract the x- and y- coordinates of the cursor position because these macros return incorrect results on systems with multiple monitors. Systems with multiple monitors can have negative x- and y- coordinates, and LOWORD and HIWORD treat the coordinates as unsigned quantities.

Note the "Important" section. You are using those macros.

If you use the GET_X_LPARAM and GET_Y_LPARAM macros it will be the coordinate relative to the upper-left corner of the client area.

The problem lies deeper, though, since (Windowsx.h):

#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
is (almost) equivalent to what he has.

It is what I suspected from the start, namely a common beginner pitfall: He uses the same dimension for the windows creation and for the D3D backbuffer. But for the latter one must use the client area of the window, e.g. optainable using GetClientRect.

@BeerNutts: Sorry for the typo. I actually watched the trailer once, so I should know better.

well honestly I don't know if the job is going to pan out, and yes I know I have problems and maybe I am not qualified but I have got to start somewhere it is only an entry level position.I am unsure of what api or engine were going to be using. basically all the details are still up in the air. if I have offended anybody I apologize. also I know I have problems finishing projects as has also been told to me by my professors in college.

well honestly I don't know if the job is going to pan out, and yes I know I have problems and maybe I am not qualified but I have got to start somewhere it is only an entry level position.I am unsure of what api or engine were going to be using. basically all the details are still up in the air. if I have offended anybody I apologize. also I know I have problems finishing projects as has also been told to me by my professors in college.

Reading the thread I think people's issue is more with the fact you don't seem to be investigating and experimenting and most importantly -searching- about how the pieces of your code work and why they might be causing problems.

In short it seems like you just want the answer thrown infront of you, and like an artist having someone else draw for them, that isn't going to teach you how to approach a picture.

You've already gotten some good advice of where your issues are, so start reading up and experimenting.

This topic is closed to new replies.

Advertisement