gamedevlists-windows Mailing List for gamedev (Page 8)
Brought to you by:
vexxed72
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(48) |
Oct
(58) |
Nov
(49) |
Dec
(38) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(124) |
Feb
(83) |
Mar
(17) |
Apr
(37) |
May
(12) |
Jun
(20) |
Jul
(47) |
Aug
(74) |
Sep
(62) |
Oct
(72) |
Nov
(54) |
Dec
(13) |
2003 |
Jan
(36) |
Feb
(8) |
Mar
(38) |
Apr
(3) |
May
(6) |
Jun
(133) |
Jul
(20) |
Aug
(18) |
Sep
(12) |
Oct
(4) |
Nov
(28) |
Dec
(36) |
2004 |
Jan
(22) |
Feb
(51) |
Mar
(28) |
Apr
(9) |
May
(20) |
Jun
(9) |
Jul
(37) |
Aug
(20) |
Sep
(23) |
Oct
(15) |
Nov
(23) |
Dec
(27) |
2005 |
Jan
(22) |
Feb
(20) |
Mar
(5) |
Apr
(14) |
May
(10) |
Jun
|
Jul
(6) |
Aug
(6) |
Sep
|
Oct
(12) |
Nov
(1) |
Dec
|
2006 |
Jan
(18) |
Feb
(4) |
Mar
(3) |
Apr
(6) |
May
(4) |
Jun
(3) |
Jul
(16) |
Aug
(40) |
Sep
(6) |
Oct
(1) |
Nov
|
Dec
(2) |
2007 |
Jan
(5) |
Feb
(2) |
Mar
(4) |
Apr
(1) |
May
(13) |
Jun
|
Jul
(26) |
Aug
(3) |
Sep
(10) |
Oct
|
Nov
(4) |
Dec
(5) |
2008 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Brian H. <ho...@bo...> - 2006-01-14 20:44:33
|
On Sat, 14 Jan 2006 09:02:34 -0700, Andras Balogh wrote: > While we are at tools: Did you know that Visual C++ 2005 Express is > absolutely free (even for commercial use)? Yeah, but I still use VC++ 6.0 w/ Visual Assist. Kickin' it old school. Every release since then has pissed me off righteously in some way or another. Brian |
From: Andras B. <and...@gm...> - 2006-01-14 16:02:48
|
While we are at tools: Did you know that Visual C++ 2005 Express is absolutely free (even for commercial use)? It features the same optimizing compiler, and the only major things it misses are the ATL and MFC libraries, and some advanced features like remote debugging.. It also uses the online MSDN for help, which means it does not eat up your harddrive, and it's more up to date. I think it's worth giving a try. I'm sorry if this is not news, but I've only found it out recently and was pleasantly surprised. I think it's great for indie developers. Andras Saturday, January 14, 2006, 12:18:15 AM, you wrote: > On Fri, 13 Jan 2006 21:30:05 -0800, Jon Watte wrote: >> >> MSDN documents CLEARTYPE_QUALITY as separate from >> ANTIALIAS_QUALITY, for Windows XP and above. > Argh, not in my version of MSDN and SDK tools =/ Anyway, this'll > work, thanks! > Brian |
From: Brian H. <ho...@bo...> - 2006-01-14 07:18:22
|
On Fri, 13 Jan 2006 21:30:05 -0800, Jon Watte wrote: > > MSDN documents CLEARTYPE_QUALITY as separate from > ANTIALIAS_QUALITY, for Windows XP and above. Argh, not in my version of MSDN and SDK tools =3D/ Anyway, this'll work, thanks! Brian |
From: Jon W. <hp...@mi...> - 2006-01-14 05:30:15
|
MSDN documents CLEARTYPE_QUALITY as separate from ANTIALIAS_QUALITY, for Windows XP and above. You can also set NONANTIALIASED_QUALITY which will make the font not anti-alias (works on all Windows). A font needs to be selected into a physical device DC before it will do anti-aliasing. Thus, if you create a font, and only select it into a DIBsection DC, it will draw without anti-aliasing. You can then upload this text to a texture or whatnot to render to screen (or draw the DIBsection). It's roundabout, but documented, and works. Cheers, / h+ Brian Hook wrote: > On Fri, 13 Jan 2006 18:57:00 -0700, Andras Balogh wrote: > >>When you create your font with CreateFont(), you can specify the >>rendering type with the fdwQuality parameter. > > > I wasn't under the impression that it provided a fine grain selection > between CT, AA, and point sample? > > Brian -- -- The early bird gets the worm, but the second mouse gets the cheese. |
From: Brian H. <ho...@bo...> - 2006-01-14 04:10:58
|
On Fri, 13 Jan 2006 18:57:00 -0700, Andras Balogh wrote: > When you create your font with CreateFont(), you can specify the > rendering type with the fdwQuality parameter. I wasn't under the impression that it provided a fine grain selection between CT, AA, and point sample? Brian |
From: Andras B. <and...@gm...> - 2006-01-14 01:57:22
|
When you create your font with CreateFont(), you can specify the rendering type with the fdwQuality parameter. Brian Hook wrote: > Is there a way to disable ClearType and revert to a cruder form of AA > (or none at all) when doing font rendering? I'm rendering to an > HBITMAP which I then use for a texture, and ClearType doesn't work so > hot with the rest of the graphics pipeline. > > Brian |
From: Jason S. <ja...@wi...> - 2006-01-14 01:26:45
|
This might help: http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/gdicpp= / GDIPlus/usingGDIPlus/usingtextandfonts/antialiasingwithtext.asp=20 -----Original Message----- From: gam...@li... [mailto:gam...@li...] On Behalf Of Brian Hook Sent: Friday, January 13, 2006 5:15 PM To: gam...@li... Subject: [GD-Windows] Disabling ClearType programmatically? Is there a way to disable ClearType and revert to a cruder form of AA (or none at all) when doing font rendering? I'm rendering to an HBITMAP which I then use for a texture, and ClearType doesn't work so hot with the rest of the graphics pipeline. Brian ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dick _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_idU5 |
From: Brian H. <ho...@bo...> - 2006-01-14 01:14:56
|
Is there a way to disable ClearType and revert to a cruder form of AA (or none at all) when doing font rendering? I'm rendering to an HBITMAP which I then use for a texture, and ClearType doesn't work so hot with the rest of the graphics pipeline. Brian |
From: Brian H. <ho...@bo...> - 2006-01-05 05:12:19
|
Found the culprit. Basically it was a resource exhaustion problem. My basic font rendering was: SelectObject(hdc, font); hbm =3D CreateCompatibleBitmap( hdcDisplay, w, h ); hbmOld=3DSelectObject(hdc,hbm); TextOut(hdc, 0, 0, buf, strlen(buf)); SelectObject(hdc,hbmOld); GetDIBBits( ... ); //get BMI info GetDIBBits( ... ); //get actual data free( bits ); free( bmi ); SelectObject( hdc, hfontOld ); The font in use is retained across calls, as is the DC I created (using CreateCompatibleDC()). So this function basically just selects a font into the DC, creates a bitmap, selects the bitmap, renders text, deselects the bitmap, grabs the bits, frees them, unselects the font. The problem was that I was forgetting to call DeleteObject( hbm ) -- I was creating a new bitmap every time the function was called, which is why it was happening that "1% of times" -- it took probably a few hundred calls (at like 20 calls/second) for it to manifest. My guess is that HBITMAPs were exhausted or something (these were pretty small bitmaps, probably 8K or so each), but instead of dying on me and reporting an error where you'd expect, it actually died on me inside GetDIBBits() after I received a valid HBITMAP. The NEXT time through it would then die on CreateCompatibleBitmap(), so I'm assuming that some kind of resource acquisition/lock was failing inside of GetDIBBits() that was failing even though I had a valid HBITMAP. Adding DeleteObject() made the problem go away, so I'm a happy programmer (for now). Still not sure why GetLastError() wasn't reporting anything, but oh well. Brian |
From: Brian H. <ho...@bo...> - 2006-01-05 03:28:44
|
On Wed, 04 Jan 2006 19:14:36 -0800, Dan Thompson wrote: > Any possibility of threading issues? Doubtful -- it's a Python installation and this is just a simple extension for it, no multithreading. > If the second one fails, you might be able to disasm into gdi and > see whats up. Could try VirtualAllocing the memory and protect it > vs Write on the second call, see if it even touches the memory. I'm not quite that hardcore =3D) Brian |
From: Dan T. <da...@ar...> - 2006-01-05 03:13:42
|
Any possibility of threading issues? If you add a second call to GetDIBits right after (i.e. on skitzo fail, try agian), does it work or fail again? Maybe toss a Sleep(1) between the two? If the second one fails, you might be able to disasm into gdi and see whats up. Could try VirtualAllocing the memory and protect it vs Write on the second call, see if it even touches the memory. All I got. -Dan Brian Hook wrote: >On Wed, 4 Jan 2006 18:29:22 -0700, Bryan Wagstaff wrote: > > >>Are you absolutely positive you don't call anything that sets the >>Windows error before you read it? >> >> > >Yeah, very next line is the check and report. This one is mystifying >me, leading me to think it's a memory corruption issue because it only >happens about 1% of the time using the exact same inputs. > >Brian > > > >------------------------------------------------------- >This SF.net email is sponsored by: Splunk Inc. Do you grep through log files >for problems? Stop! Download the new AJAX search engine that makes >searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! >http://ads.osdn.com/?ad_idv37&alloc_id865&op=click >_______________________________________________ >Gamedevlists-windows mailing list >Gam...@li... >https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows >Archives: >http://sourceforge.net/mailarchive/forum.php?forum_idU5 > > > > |
From: Brian H. <ho...@bo...> - 2006-01-05 02:50:35
|
On Wed, 4 Jan 2006 18:29:22 -0700, Bryan Wagstaff wrote: > Are you absolutely positive you don't call anything that sets the > Windows error before you read it? Yeah, very next line is the check and report. This one is mystifying me, leading me to think it's a memory corruption issue because it only happens about 1% of the time using the exact same inputs. Brian |
From: Bryan W. <br...@xm...> - 2006-01-05 01:29:38
|
Are you absolutely positive you don't call anything that sets the = Windows error before you read it? I spent a few days trying to figure out why a certain bit of code always logged windows error 2, but I couldn't get an error when run in the debugger. After a while, I realized that the logging macros were = resetting the error code to either 0 or 2. The error 2 came from trying to write = to the debugger when it wasn't attached. Just something to look for. Bryan. -----Original Message----- From: gam...@li... [mailto:gam...@li...] On Behalf Of = Brian Hook Sent: Wednesday, January 04, 2006 3:42 PM To: gam...@li... Subject: [GD-Windows] GetDIBits() return values On occasion GetDIBits() returns 0, indicating failure, but=20 GetLastError() returns 0, indicating success. The dimensions I pass=20 in are scan start=3D0,scanlines=3D12. Everything seems to work fine, = but=20 very occasionally (< 1% of the time) I get a return value that !=3D 12. Anyone know under what conditions this might happen? Thanks, Brian ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log = files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dick _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_idU5 |
From: Brian H. <ho...@bo...> - 2006-01-04 22:41:54
|
On occasion GetDIBits() returns 0, indicating failure, but GetLastError() returns 0, indicating success. The dimensions I pass in are scan start=3D0,scanlines=3D12. Everything seems to work fine, but very occasionally (< 1% of the time) I get a return value that !=3D 12. Anyone know under what conditions this might happen? Thanks, Brian |
From: Andras B. <and...@gm...> - 2005-11-29 06:28:42
|
I'm not sure if this is the right list to ask this question (it spans across Windows, DirectShow, OpenGL and a bit of D3D even), so if you think you know of a better place to ask, then please don't hesitate to redirect me. :) I'm trying to stream video files and real-time captured video frames (eg. from webcam, tv tuner, etc..) into OpenGL textures. First, I've looked into Video For Windows. The API is simple, the docs is good, implementation is a snap. So now I can play AVI files anywhere there is a texture. It looks great! :) Video for Windows is far from perfect though. It only supports AVI files (no MPEG, WMV or other fancy formats), it decompresses the frames into system memory (which is somewhat inefficient), and it doesn't support capturing frames from external sources at all. So I turned my attention towards DirectShow. This solution is waay more complex, and after intensive Googling, browsing the MSDN, and the SDK samples for two days, there are still some unanswered questions. So here I am. :) I understand the part where I have to create a filter graph, which is very flexible, and enables me to play back basically anything that I have a DirectShow codec or WDM driver for. The part where I get confused is how do I get my hands on the frame image data itself? There seems to be a couple ways to do it. One of them is using the ISampleGrabber filter. One thing I don't understand about this method is I couldn't put this filter after the decoder in graphEdit. It would always put an extra AVI decompressor plus a color space converter afterwards. Why is that? I feel that the documentation is lacking, I don't have a clear undersanding about what this filter actually does. Also, the doc says that its header file is incompatible with newer directx headers, and that made me feel a bit uneasy. Is this some deprecated API? Then I've found the VMR-9. Everyone is raving about it, HW accelerated deinterlacing, color space conversion, muxing multiple sources, renders straight into VRAM, etc... Seems like exactly what I need! Unfortunately, this is the most complicated solution of all. I have found samples that demonstrate how to decode video into DirectX surfaces, but I don't know too muh about DX, I'd like to avoid that as much as possible.. I've read that I have make my custom implementation of VMR's allocator interface, but it seems like that this interface only takes a pointer to a DX surface. What I'd love to be able to do instead, is to just pass an arbitrary pointer (that would probably point straight into a PBO, from where texture updates should be lightning fast). Question #1: Do I really need to create a DirectX surface, and render the video frames into that? Is this the only way? If yes, how can I copy this data over to OpenGL efficiently? Question #2: I read somewhere that VMR-9 does not work with captured video?? Can anyone confirm/deny this? If that's the case it would be pretty much useless for me.. Question #3: What other options are there that I've missed? As a sidenote, I did see the nVidia samples, but the OpenGL version is a mess and the precompiled version they provided in the SDK does not even work, so I didn't look too hard there. If anyone knows a better VMR-9/GL sample that would be great! But all I'm really looking for is some pointers in the right direction. I just don't want to spend days on figuring out something, when that something might not even work for me at all. Thanks, Andras |
From: Chris R. <c....@gm...> - 2005-10-29 12:10:29
|
> Their unit test tools would be good if they were the only game in town, but > there are cppunit and nunit that MS has to compete with. You might notice > that in most of the MS Developers' presentations, they have the > TestDriven.net plug-in installed on their VS2005 systems. We have been using cppunit for quite a while now and are quite satisfied with it's usability. It is just sad that there is no IDE integration for it, all usage of cppunit has to be done by hand (creating a test-file, adding test-cases, etc). > Refactoring tools (both free and commercial) have been around for quite some > time and MS's short list of features look like the bare minimum that they > could get away with and still call it "refactoring tools". If you want a > serious tool for that, look elsewhere. The refactoring offerings in MS's > betas have been lackluster. Spend the money and buy 3rd party if you are > serious about doing it. We have been using the ref++ plugin from http://www.refpp.com . Again, here the drawback is that ref++ needs to rebuild it's parsing cache everytime you want to use it (and that can become a pain with large projects). I am not aware of other refactoring tools/plugins for c++ for visual studio. > > They integrated FxCop, which isn't too surprising since it came from MS to > begin with. That tool does static and dynamic code analysis for managed assemblies? What about code analysis, especially profiling, for native applications? In VS 6 they had this not very powerful, but still useful, profiling option for c/c++ code. Somehow it vanished in VS.Net and I miss it. We purchased several licenses of Intel VTune to replace it - a very nice suite of tools for performance analysis if it does not get confused and lose synbol information for your project. > They are collaboration tools that you might (or might not) find useful. > There are a lot of good features in there for end-to-end tracking: from the > bug report to the final feedback. We liked some of the features, but > decided to stay away from it in the end because our existing tools offered > the features we needed, were free, and have already been customized to fit > our environment. To add to that, it seems as if you get into license hell with it. It seems as if everybody on the team would need to have a user license to access the foundation server, plus a client license to use the client tools. Seems as if we will stick to python scripts and bugzilla for now. Seems as if I have not missed much in the last year. All this marketing voodoo sounded to good to be true. Thanks for your insights! regards, Chris Raine |
From: Bryan W. <br...@xm...> - 2005-10-29 04:18:33
|
On Friday, October 28, 2005 4:55 PM Chris Raine said: > I would like to know which improvements to Visual Studio regarding C++ development have been added (subquestion : What about automated unit-tests, refactoring for C++ ?). VS2005 has had betas available for about a year. I'm surprised you haven't tried it out, at least to see if your code still compiles. ;-) After the initial shock of every file needing to irrevocably migrate from the 2003 format to the 2005 format, it looks pretty good. (C'mon people, it's XML; you shouldn't need to do that any more...) There are many incremental improvements. There are many additions that seem more like trying to compete with the free and commercial plug-ins. It looks a lot more like office. It integrates with the other apps, for better or worse. The tools you mentioned have been available through other means for quite some time, even outside the VS2005 betas. We've been using better tools and I feel like MS is just trying to play catch up on them. Their unit test tools would be good if they were the only game in town, but there are cppunit and nunit that MS has to compete with. You might notice that in most of the MS Developers' presentations, they have the TestDriven.net plug-in installed on their VS2005 systems. Refactoring tools (both free and commercial) have been around for quite some time and MS's short list of features look like the bare minimum that they could get away with and still call it "refactoring tools". If you want a serious tool for that, look elsewhere. The refactoring offerings in MS's betas have been lackluster. Spend the money and buy 3rd party if you are serious about doing it. They integrated FxCop, which isn't too surprising since it came from MS to begin with. > And what is this Team Server or Team Foundation thing all about? What benefits would my development team have if we start using it? They are collaboration tools that you might (or might not) find useful. There are a lot of good features in there for end-to-end tracking: from the bug report to the final feedback. We liked some of the features, but decided to stay away from it in the end because our existing tools offered the features we needed, were free, and have already been customized to fit our environment. > What about nice features tailored towards game development (asset management, etc) ? I read about a special version of Visual Studio 2005 tailored for game developers a few months ago, but I cannot find a single reference to game development on Microsoft's VS site. You might be referring to XNA and XNA Studio. I've read about it but haven't seen anything beyond marketing. Others might know more about it. I have heard through the grapevine that the version control in TFS is moderately good at handling binary assets, but I haven't looked in to that either. Our asset chain is pretty good already. I know they updated Visual SourceSafe, but it still uses file shares so I wouldn't trust it. As always, your mileage may vary. bryan |
From: Chris R. <c....@gm...> - 2005-10-28 22:55:10
|
Visual Studio 2005 has been released recently (today?), and I find myself in the position of manually searching through tons of marketing-voodoo on Microsoft's Visual Studio site. I would like to know which improvements to Visual Studio regarding C++ development have been added (subquestion : What about automated unit-tests, refactoring for C++ ?). And what is this Team Server or Team Foundation thing all about? What benefits would my development team have if we start using it? What about nice features tailored towards game development (asset management, etc) ? I read about a special version of Visual Studio 2005 tailored for game developers a few months ago, but I cannot find a single reference to game development on Microsoft's VS site. Maybe someone on this list with access to the early-beta's can shed some light on these topics for me. I gave up on the MS site feeling rather confused and lost after an hour. regards and thanks in advance, Chris Raine |
From: Alen L. <ale...@cr...> - 2005-10-18 12:11:52
|
I believe that ScreenToClient() is the simplest solution for that. Alen ----- Original Message -----=20 From: "Jason Morales" <ja...@s2...> To: <gam...@li...> Sent: Tuesday, October 18, 2005 2:12 PM Subject: Re: [GD-Windows] Mouse position Check out GetClientRect() and AdjustWindowRect as well, those should give you all the info you need. Here is how we get the mouse position in our game: CRecti CSystem::GetWindowArea() { RECT full, client; int clientw, clienth; int style; if (Vid.IsFullScreen()) style =3D WS_POPUP | WS_MAXIMIZE; else style =3D WS_CAPTION | WS_MINIMIZEBOX | WS_VISIBLE; GetClientRect((HWND)m_WindowHandle, &client); clientw =3D client.right; clienth =3D client.bottom; AdjustWindowRect(&client, style, false); GetWindowRect((HWND)m_WindowHandle, &full); return CRecti(full.left - client.left, full.top - client.top, full.left - client.left + clientw, full.top - client.top + clienth); } CVec2i CSystem::GetMousePos() { CRecti winrec =3D GetWindowArea(); POINT p; ::GetCursorPos(&p); return CVec2i(p.x - winrec.left, p.y - winrec.top); } Diogo de Andrade wrote: > Hey all=85 > > I=92m having a small problem getting the coordinate of the mouse in the= =20 > window=85 My current system gets the coordinate like this: > > POINT pt; > > GetCursorPos(&pt); > > Then I want to transform this coordinate (in absolute screen coordinate= s,=20 > as I see it) to my engine's coordinates (which has logical coordinates,= to=20 > account for different resolutions, bitmap scaling, etc)... > > I get the window rectangle (also in screen coordinates): > > RECT rect; > > GetWindowRect(m_window,&rect); > > Finally, I do the conversion itself > > float sx=3Drect.right-rect.left; > > float sy=3Drect.bottom-rect.top; > > float relative_x=3Dvirtual_res_x*(pt.x-rect.left)/sx; > > float relative_y=3Dvirtual_res_y*(pt.y-rect.top)/sy; > > This works almost perfectly, except when I approach the cursor from the= =20 > top of the window... The window has the standard bar (created with=20 > WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBO= X |=20 > WS_MAXIMIZEBOX | WS_VISIBLE | WS_POPUPWINDOW), and apparently=20 > GetWindowRect gets the whole window, including the top bar, instead of=20 > getting only the "drawable" part of it... I imagine the problem is that= =20 > m_window above is a parent window with 2 children (the system bar, and = the=20 > drawable part), but I can't find how to get just the drawable rectangle= to=20 > do the conversion... This works fine if I create the window without bor= der=20 > of title/system bar... So, my question is: how do I get the drawable pa= rt=20 > of the window's rectangle? > > Thanks in advance! > > Diogo de Andrade > > Creative & Technical Director > > Spellcaster Studios > > dio...@sp... > > www.spellcasterstudios.com > ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_idU5 |
From: Jason M. <ja...@s2...> - 2005-10-18 12:06:20
|
Check out GetClientRect() and AdjustWindowRect as well, those should=20 give you all the info you need. Here is how we get the mouse position in our game: CRecti CSystem::GetWindowArea() { RECT full, client; int clientw, clienth; int style; if (Vid.IsFullScreen()) style =3D WS_POPUP | WS_MAXIMIZE; else style =3D WS_CAPTION | WS_MINIMIZEBOX | WS_VISIBLE; GetClientRect((HWND)m_WindowHandle, &client); clientw =3D client.right; clienth =3D client.bottom; AdjustWindowRect(&client, style, false); GetWindowRect((HWND)m_WindowHandle, &full); return CRecti(full.left - client.left, full.top - client.top, full.left - client.left + clientw, full.top - client.top + clienth); } CVec2i CSystem::GetMousePos() { CRecti winrec =3D GetWindowArea(); POINT p; ::GetCursorPos(&p); return CVec2i(p.x - winrec.left, p.y - winrec.top); } Diogo de Andrade wrote: > Hey all=85 > > I=92m having a small problem getting the coordinate of the mouse in the= =20 > window=85 My current system gets the coordinate like this: > > POINT pt; > > GetCursorPos(&pt); > > Then I want to transform this coordinate (in absolute screen=20 > coordinates, as I see it) to my engine's coordinates (which has=20 > logical coordinates, to account for different resolutions, bitmap=20 > scaling, etc)... > > I get the window rectangle (also in screen coordinates): > > RECT rect; > > GetWindowRect(m_window,&rect); > > Finally, I do the conversion itself > > float sx=3Drect.right-rect.left; > > float sy=3Drect.bottom-rect.top; > > float relative_x=3Dvirtual_res_x*(pt.x-rect.left)/sx; > > float relative_y=3Dvirtual_res_y*(pt.y-rect.top)/sy; > > This works almost perfectly, except when I approach the cursor from=20 > the top of the window... The window has the standard bar (created with=20 > WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME |=20 > WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE | WS_POPUPWINDOW), and=20 > apparently GetWindowRect gets the whole window, including the top bar,=20 > instead of getting only the "drawable" part of it... I imagine the=20 > problem is that m_window above is a parent window with 2 children (the=20 > system bar, and the drawable part), but I can't find how to get just=20 > the drawable rectangle to do the conversion... This works fine if I=20 > create the window without border of title/system bar... So, my=20 > question is: how do I get the drawable part of the window's rectangle? > > Thanks in advance! > > Diogo de Andrade > > Creative & Technical Director > > Spellcaster Studios > > dio...@sp... > > www.spellcasterstudios.com > |
From: Diogo de A. <dio...@ne...> - 2005-10-18 11:35:28
|
Hey all. I'm having a small problem getting the coordinate of the mouse in the window. My current system gets the coordinate like this: POINT pt; GetCursorPos(&pt); Then I want to transform this coordinate (in absolute screen coordinates, as I see it) to my engine's coordinates (which has logical coordinates, to account for different resolutions, bitmap scaling, etc)... I get the window rectangle (also in screen coordinates): RECT rect; GetWindowRect(m_window,&rect); Finally, I do the conversion itself float sx=rect.right-rect.left; float sy=rect.bottom-rect.top; float relative_x=virtual_res_x*(pt.x-rect.left)/sx; float relative_y=virtual_res_y*(pt.y-rect.top)/sy; This works almost perfectly, except when I approach the cursor from the top of the window... The window has the standard bar (created with WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE | WS_POPUPWINDOW), and apparently GetWindowRect gets the whole window, including the top bar, instead of getting only the "drawable" part of it... I imagine the problem is that m_window above is a parent window with 2 children (the system bar, and the drawable part), but I can't find how to get just the drawable rectangle to do the conversion... This works fine if I create the window without border of title/system bar... So, my question is: how do I get the drawable part of the window's rectangle? Thanks in advance! Diogo de Andrade Creative & Technical Director Spellcaster Studios dio...@sp... www.spellcasterstudios.com |
From: Chris R. <c....@gm...> - 2005-10-06 13:05:12
|
That actually worked out pretty well. I still believe (although I am not sure) that the debugger injects it's memory handlers into the running application at the point it attaches itself to the process. I let my application run for a while and attached the debugger later on - and I easily could pinpoint the offending line of code which caused this mayhem after a few retries and a few minutes of heavy thinking. We actually had two memory related issues - one uninitialized pointer, and as an indirect consequence of that, we took the pointer of an object on the stack and used it after it was destroyed long ago. Thanks for all the insights (especially the _heapfill()&co functions)! regards, Chris Raine On Wed, 2005-10-05 at 19:52 -0700, Mike Burrows wrote: > I don't know of a way to disable this, but I'll ask around... > > Have you tried attaching to the process after "Running" (note: note debugging)? > > Just a thought, > > Cheers, Mike > > -----Original Message----- > From: gam...@li... [mailto:gam...@li...] On Behalf Of Emmanuel Astier > Sent: Wednesday, October 05, 2005 9:00 AM > To: gam...@li... > Subject: Re: [GD-Windows] Release build confusion > > I second that. > > I had the same issue noe month ago : crashing outside > VS, not crashing inside. > And it was a non initialized pointer that lead to the > crash. > > Funny thing is, one week later, I had the opposite > behaviour : crashing inside VS, not crashing outside, > still for memory reasons... > > What I'm not aware of, is a way to tell VS not to > behave this way. Is there a way ? > > > Emmanuel > > > --- Kent Quirk <ken...@co...> a écrit : > > > I believe that unless you tell it not to, the > > debugger fills > > newly-allocated memory with zeros. You may be > > counting on that behavior > > somewhere. Check your initializations, particularly > > of pointers; you may > > assume they're zero if they haven't yet been > > assigned. > > > > Kent > > > > > > > > Chris Raine wrote: > > > > >Hi, > > > > > >I have a problem with our release builds which is > > driving me nuts for a > > >couple of days now. If we start our release build > > from within the Visual > > >Studio debugger, everything works fine, yet if we > > start our release > > >build outside of Visual Studio, it either crashes > > or displays weird > > >render artifacts. The debug build works in the IDE > > as well as outside. > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: > > Power Architecture Resource Center: Free content, > > downloads, discussions, > > and more. > > http://solutions.newsforge.com/ibmarch.tmpl > > _______________________________________________ > > Gamedevlists-windows mailing list > > Gam...@li... > > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > Archives: > > > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > > > > > > > > > ___________________________________________________________________________ > Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger > Téléchargez cette version sur http://fr.messenger.yahoo.com > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_idU5 > |
From: Andrew G. <ag...@cl...> - 2005-10-06 06:29:17
|
Like Mike says (hi Mike, sorry I missed you in Brighton btw :)) I don't think there's anyway to disable this, it's an implicit behaviour of the debug heap. However you *CAN* control what the heap is filled with = while debugging (see _heapfill etc) and this is something you should = certainly make use of. Personally I consider utilising this functionality to be as fundamental = as checking (and asserting on) memory leaks in debug versions. If you = aren't considering the case where allocated memory has undefined values then = at best you're setting yourself up for undefined behaviour, and at worst horrible crashes that only occur after playing X number of levels. Our memory manager allows you to toggle the value which = allocated/free'd memory is filled with, and different people use different settings to = catch problems. Personally I have everything filled with NANs and run with floating point exceptions as I find this to be most useful on a day to = day basis. ________________________ andrew grant lead programmer . climax group =20 > -----Original Message----- > From: gam...@li... [mailto:gamedevlists- > win...@li...] On Behalf Of Mike Burrows > Sent: Wednesday, October 05, 2005 7:52 PM > To: gam...@li... > Subject: RE: [GD-Windows] Release build confusion >=20 > I don't know of a way to disable this, but I'll ask around... >=20 > Have you tried attaching to the process after "Running" (note: note debugging)? >=20 > Just a thought, >=20 > Cheers, Mike >=20 > -----Original Message----- > From: gam...@li... [mailto:gamedevlists- > win...@li...] On Behalf Of Emmanuel Astier > Sent: Wednesday, October 05, 2005 9:00 AM > To: gam...@li... > Subject: Re: [GD-Windows] Release build confusion >=20 > I second that. >=20 > I had the same issue noe month ago : crashing outside > VS, not crashing inside. > And it was a non initialized pointer that lead to the > crash. >=20 > Funny thing is, one week later, I had the opposite > behaviour : crashing inside VS, not crashing outside, > still for memory reasons... >=20 > What I'm not aware of, is a way to tell VS not to > behave this way. Is there a way ? >=20 >=20 > Emmanuel >=20 >=20 > --- Kent Quirk <ken...@co...> a =E9crit : >=20 > > I believe that unless you tell it not to, the > > debugger fills > > newly-allocated memory with zeros. You may be > > counting on that behavior > > somewhere. Check your initializations, particularly > > of pointers; you may > > assume they're zero if they haven't yet been > > assigned. > > > > Kent > > > > > > > > Chris Raine wrote: > > > > >Hi, > > > > > >I have a problem with our release builds which is > > driving me nuts for a > > >couple of days now. If we start our release build > > from within the Visual > > >Studio debugger, everything works fine, yet if we > > start our release > > >build outside of Visual Studio, it either crashes > > or displays weird > > >render artifacts. The debug build works in the IDE > > as well as outside. > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: > > Power Architecture Resource Center: Free content, > > downloads, discussions, > > and more. > > http://solutions.newsforge.com/ibmarch.tmpl > > _______________________________________________ > > Gamedevlists-windows mailing list > > Gam...@li... > > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > Archives: > > > http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 > > >=20 >=20 >=20 >=20 >=20 >=20 >=20 > __________________________________________________________________ > _________ > Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! = Messenger > T=E9l=E9chargez cette version sur http://fr.messenger.yahoo.com >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, = discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, = discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_idU5 |
From: Mike B. <mi...@wi...> - 2005-10-06 02:52:34
|
I don't know of a way to disable this, but I'll ask around... Have you tried attaching to the process after "Running" (note: note = debugging)? Just a thought, Cheers, Mike -----Original Message----- From: gam...@li... = [mailto:gam...@li...] On Behalf Of = Emmanuel Astier Sent: Wednesday, October 05, 2005 9:00 AM To: gam...@li... Subject: Re: [GD-Windows] Release build confusion I second that. I had the same issue noe month ago : crashing outside VS, not crashing inside. And it was a non initialized pointer that lead to the crash. Funny thing is, one week later, I had the opposite behaviour : crashing inside VS, not crashing outside, still for memory reasons... What I'm not aware of, is a way to tell VS not to behave this way. Is there a way ? Emmanuel --- Kent Quirk <ken...@co...> a =E9crit : > I believe that unless you tell it not to, the > debugger fills=20 > newly-allocated memory with zeros. You may be > counting on that behavior=20 > somewhere. Check your initializations, particularly > of pointers; you may=20 > assume they're zero if they haven't yet been > assigned. >=20 > Kent >=20 >=20 >=20 > Chris Raine wrote: >=20 > >Hi,=20 > > > >I have a problem with our release builds which is > driving me nuts for a > >couple of days now. If we start our release build > from within the Visual > >Studio debugger, everything works fine, yet if we > start our release > >build outside of Visual Studio, it either crashes > or displays weird > >render artifacts. The debug build works in the IDE > as well as outside.=20 > > > > =20 > > >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, > downloads, discussions, > and more. > http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 >=20 =09 =09 =09 _________________________________________________________________________= __=20 Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! = Messenger=20 T=E9l=E9chargez cette version sur http://fr.messenger.yahoo.com ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, = discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 |
From: Emmanuel A. <e_a...@ya...> - 2005-10-05 16:00:12
|
I second that. I had the same issue noe month ago : crashing outside VS, not crashing inside. And it was a non initialized pointer that lead to the crash. Funny thing is, one week later, I had the opposite behaviour : crashing inside VS, not crashing outside, still for memory reasons... What I'm not aware of, is a way to tell VS not to behave this way. Is there a way ? Emmanuel --- Kent Quirk <ken...@co...> a écrit : > I believe that unless you tell it not to, the > debugger fills > newly-allocated memory with zeros. You may be > counting on that behavior > somewhere. Check your initializations, particularly > of pointers; you may > assume they're zero if they haven't yet been > assigned. > > Kent > > > > Chris Raine wrote: > > >Hi, > > > >I have a problem with our release builds which is > driving me nuts for a > >couple of days now. If we start our release build > from within the Visual > >Studio debugger, everything works fine, yet if we > start our release > >build outside of Visual Studio, it either crashes > or displays weird > >render artifacts. The debug build works in the IDE > as well as outside. > > > > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, > downloads, discussions, > and more. > http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > ___________________________________________________________________________ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com |