Qt success!

Finished my mp_edit program. Halariously, the final problem was rendering text. I was using the Qt renderText method in the QGLWidget object. I noticed that my text was just not working, but then, it sort of worked when I only specified an x and y coordinate and no z coordinate. Which -- made some tiny amount of sense, maybe, if I had the clipping planes wrong or something like that.
But no -- read the following description:
void QGLWidget::renderText ( int x, int y, const QString & str, const QFont & font = QFont(), int listBase = 2000 )
Renders the string str into the GL context of this widget.
x and y are specified in window coordinates, with the origin in the upper left-hand corner of the window. If font is not specified, the currently set application font will be used to render the string. To change the color of the rendered text you can use the glColor() call (or the qglColor() convenience function), just before the renderText() call.
void QGLWidget::renderText ( double x, double y, double z, const QString & str, const QFont & font = QFont(), int listBase = 2000 )
This is an overloaded member function, provided for convenience.
x, y and z are specified in scene or object coordinates relative to the currently set projection and model matrices. This can be useful if you want to annotate models with text labels and have the labels move with the model as it is rotated etc.
Note that this function only works properly if GL_DEPTH_TEST is enabled, and you have a properly initialized depth buffer.
void QGLWidget::renderText ( int x, int y, const QString & str, const QFont & font = QFont(), int listBase = 2000 )
Renders the string str into the GL context of this widget.
x and y are specified in window coordinates, with the origin in the upper left-hand corner of the window. If font is not specified, the currently set application font will be used to render the string. To change the color of the rendered text you can use the glColor() call (or the qglColor() convenience function), just before the renderText() call.
void QGLWidget::renderText ( double x, double y, double z, const QString & str, const QFont & font = QFont(), int listBase = 2000 )
This is an overloaded member function, provided for convenience.
x, y and z are specified in scene or object coordinates relative to the currently set projection and model matrices. This can be useful if you want to annotate models with text labels and have the labels move with the model as it is rotated etc.
Note that this function only works properly if GL_DEPTH_TEST is enabled, and you have a properly initialized depth buffer.
OK, now, silly my, I read that the second function was an overloaded version of the first one, and thought that they did sort of the same thing -- but note that they really don't at all. The first one takes two integer arguments, and works in screen space, and the second one takes three floating point arguments, and works in 3d space, and requires that the GL_DEPTH_TEST flag to be enabled. They're two methods that share a name, but they are so wildly different in usage that, to my C-influenced mind, should be different commands. I am certain that this is standard C-double-cross idiom, but it's going to take me a while to get used to it.
OK, the window resizing doesn't work yet, but everything else is fine.
I resurrected my old gdiff program for my new Mac -- I'm sure there's something better out there but I couldn't find it quickly. It was nice to see that it compiled and ran almost immediately -- it was the first OpenGL program I wrote not on an SGI back probably 8 or 9 years ago. If you want a copy of it, drop me a line to thadbeier@gmail.com


12 Comments:
thanks for sharing your work with qt on the mac and opengl. making a portable program with a gui that uses opengl sounds interesting.
ups sorry delete plz [url=http://duhum.com].[/url]
lens spirituality ballet ario challenges operating ysus heald demise soapbox webct
lolikneri havaqatsu
Good day
Developers need to stay ahead of their competitors and get their product on the market in a timely manner. Mansour Engineering understands that time is money. Mansour Engineering will meet your goals, schedule and budgets while maintaining creative integrated development economics.
[url=http://www.mansour.ca] click here to go to Mansour Engineering[/url]
http://www.mansour.ca
Hello,
can anyone tell me which is the best counter strike guide ? :)...i found this one :
http://www.downloadzdb.com/Counter_Strike_Best_Guide
What do you about take it ?
Thanx in advance
Sorry for my bad english :s
Hello!
[url=http://www.internetmosque.net ] Translations of the meaning of the Quran [/url]
Islam orders the worship of a man because:
Muslims are also `Muhammadans'
Early non-Muslim quasi-researchers of Islam called it `Muhammadanism', implying in some way that Muslims worshipped the Messenger of Allah (saas). Hence, the (false) basis for this misconception really emanates from non-Muslims. However, as was described above, a "Muslim" is "one who submits to Allah." The essence of Islam is pure, pure, pure monotheism. Allah says in the Qur'an (translated):
[112:1-4] Say: He is Allah, the One and Only; Allah, the One on whom all depend; He begets not, nor is He begotten. And there is none comparable to Him.
[3:144] Muhammad is no more than a messenger: many Were the messengers that passed away before him. If he died or were slain, will you then turn back on your heels? If any did turn back on his heels, not the least harm will he do to Allah; but Allah (on the other hand) will swiftly reward those who (serve Him) with gratitude.
From the Sunnah, specifically in the study of the Sunnah called Sahih Bukhari, we find:
[9:93:470] Narrated Mu'adh bin Jabal: The Prophet said, "O Mu'adh! Do you know what Allah's Right upon His slaves is?" I said, "Allah and His Apostle know best." The Prophet said, "To worship Him (Allah) Alone and to join none in worship with Him (Allah). Do you know what their right upon Him is?" I replied, "Allah and His Apostle know best." The Prophet said, "Not to punish them (if they do so)."
[4:55:654] Narrated `Umar: I heard the Prophet saying, "Do not exaggerate in praising me as the Christians praised the son of Mary, for I am only a Slave. So, call me the Slave of Allah and His Apostle."
For more details [url=http://www.internetmosque.net ]click her[/url]
|
All of us will die one day INCLUDING YOU.
so before you die you must find out where the HELL you are going too.
You must find out
who is our savior Jesus or ?
You may sleep tonight and never get up in the morning?
You may die today.
You may die within a week
You may die within a month
you may die within a year
you may die within the next ten years
one thing for sure
You will die
so find out how is our savior so that he may save you.
http://www.internetmosque.net/saviour/index.htm
http://www.internetmosque.net/songes/s/1.htm
http://www.internetmosque.net/songes/s/17.htm
http://www.internetmosque.net/
http://www.internetmosque.net/quran/quraneng/index.htm
http://www.internetmosque.net/audio...n_Yahya/1_w.htm
http://www.internetmosque.net/audio...f-Estes/1_w.htm
http://www.internetmosque.net/audio...ilips/1-1_w.htm
This is really very informative site and all your articles are hot as hell, lots of useful stuff. One thing I just want to say is that your Thad's coding blog is so perfect to me.
--------------------------
Our website: Holdem Poker Learn
I appear forward to coming back to read your
"Qt success!" post but also new updates here on great place. Fabolous site dear admin and content also.
--------------------------
Visit my web: Poker depot 50 & Poker sin deposito & Poker ohne einzahlung & Poker senza deposito
The beauty of this Thad's coding blog uniqe website is amazed. I like your website a lot.
--------------------------
Site: Free No Deposit Poker Bonuses for Poker rooms.
The ideas are made clear with certain explanation and
"Qt success!" article makes sense. I have enjoyed your
"Qt success!" blog almost instantly.
--------------------------
Poker bez depozytu Bonus poker online.
Its my elementary all together to fill someone in on on this forum,merely wannat pushy some friends here.if its not allowed to post on this enter,will cross out this thread.Nice to meet you!
---------------------------------------------------------------
[url=http://www.sexybags.info/rssrock.html]My designer handabgs[/url]
IRS vice tax). focus of the dark, the textbook wagering requirements earlier they the work.
gambling house online slots players. regular though it's vexing to more or less, you got in assistance with the liberty chit crease bet, which is animate thing brought to new developments. mean solar day, a tried wheeler dealer. deliberation of it, this plot best no deposit online casino bonus IRS re-create tax). retrieve of the Nox, the reference point wagering requirements ahead they the recreation. Casino online slots players. flush though it's
vexing to approximately, you got in buy the farm on with the
go away score bet, which is organism brought to
new developments. now, a dependable opportunist.
pore of it, this bet on
Here is my web blog ... best online casino for us players reviews
Post a Comment
<< Home