- Viewing Profile: Reputation: MarkS
Community Stats
- Group Members
- Active Posts 777
- Profile Views 3,565
- Member Title Member
- Age 36 years old
- Birthday March 15, 1977
-
Gender
Male
-
Location
San Antonio, TX
-
Interests
Computers, gaming, game programming, electronics, bread baking, cooking.
User Tools
Contacts
MarkS hasn't added any contacts yet.
#4988541 Reading wrong values from Joystick for the first few milliseconds
Posted by MarkS
on 09 October 2012 - 06:16 PM
I could be wrong, but that is the first thing to jump out at me.
#4984753 [For a Beginner] C++ express 2010 or C++ express 2012?
Posted by MarkS
on 28 September 2012 - 09:59 AM
I tried VS Express 2012, but it required .NET 4.5, which is required for Windows 8 and apparently incompatible with Windows 7. I had to remove all copies of .NET and anything related to Visual Studio in order to reinstall 2010 and get it working. The impression I got was Microsoft forcing the transition to Windows 8. Yes, 2012 will install in Windows 7, but don't expect to actually compile anything.
JME
#4924457 Why the efficiency a simple 2D program is so low?
Posted by MarkS
on 22 March 2012 - 04:47 PM
For 3 verts in a single triangle, doing things on the CPU should be effectively "free" - or at the very least have overhead so low that it's not even measurable. For sure you should move them to the GPU (put them in your vertex shader) but in this case they're not going to be the cause of the symptoms you describe.
I agree. Since he is learning I felt it was best to steer him away from this practice. It may be free now, but it wont be with a much higher vertex model.
I didn't look at the book he linked to, but if that code is straight from that book, it should raise flags.
#4924266 Why the efficiency a simple 2D program is so low?
Posted by MarkS
on 22 March 2012 - 05:09 AM
If your array isn't dynamic, skip std::vector and use a standard array. Send you vertex data to the GPU once and then either transform it in the vertex shader or use glRotate each frame.
#4913063 Posssible memory leak in OpenGL Intel Win7 drivers
Posted by MarkS
on 14 February 2012 - 12:29 PM
But we didn't allocate any memory here. What I understand is that after the call to glMapBuffer(), mappedBuf should be treated as GPU memory, so it's not up to us to free it. We copy the texture into this mapped memory, then call glUnmapBuffer() to indicate to OpenGL that we're done copying/modifying that buffer (the buffer that belongs to the driver, not us).
Any pointer in your code resides in CPU memory. The data contained within may come from GPU memory, but the pointer still needs to be declared in your code.
This function doesn't make any sense:
void mapAndCopyToBuffer(char* img1)
{
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pixelbufferHandle);
mappedBuf = (char*) glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
memcpy(mappedBuf, img1, w * h * s);
glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
mappedBuf = NULL;
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pixelbufferHandle);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0);
}The memcpy is copying img1 into mappedBuf and then you are setting mappedBuf to NULL. I suspect that you meant: memcpy(img1,mappedBuf,w * h * s);?
Also, since you know that img1 and mappedBuf will be w * h * s bytes, and that mappedBuf is only used in this function, why not do this:
void mapAndCopyToBuffer(char* img1)
{
char *mappedBuf;
glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pixelbufferHandle);
mappedBuf = new char[w * h * s];
mappedBuf = (char*) glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
memcpy(img1, mappedBuf, w * h * s);
glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
delete [] mappedBuf;
mappedBuf = NULL;
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pixelbufferHandle);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0);
}
#4911517 Hiring OpenGL teacher [PAYING 10$]
Posted by MarkS
on 09 February 2012 - 08:45 PM
I recommend that you use the internet to its fullest. Do research on your own (that includes asking questions here). Save your money for other things.
#4906181 Line drawing? (C#)
Posted by MarkS
on 25 January 2012 - 01:18 PM
This is based in a modified version of Bresenham's classic line drawing code.
#define ABS(x) (x < 0 ? -x : x)
#define SIGN(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
void LineTool(TileMap *map,POINT p1,POINT p2,long tile_ID)
{
long y,x;
long dy,dx;
long sx,sy;
POINT start,end;
long accum;
start.x = p1.x;
start.y = p1.y;
end.x = p2.x;
end.y = p2.y;
dx = end.x - start.x;
dy = end.y - start.y;
sx = SIGN(dx);
sy = SIGN(dy);
dx = ABS(dx);
dy = ABS(dy);
end.x += sx;
end.y += sy;
if(dx > dy)
{
accum = dx >> 1;
do{
map->map[start.y][start.x] = tile_ID;
accum -= dy;
if(accum < 0)
{
accum += dx;
start.y += sy;
}
start.x += sx;
}while(start.x != end.x);
}else{
accum = dy >> 1;
do{
map->map[start.y][start.x] = tile_ID;
accum -= dx;
if(accum < 0)
{
accum += dy;
start.x += sx;
}
start.y += sy;
}while(start.y != end.y);
}
}
#4904477 The Sunset Strider
Posted by MarkS
on 19 January 2012 - 11:48 PM
#4897647 GameDev.net 2012
Posted by MarkS
on 28 December 2011 - 05:19 PM
#4880522 PDB files in OpenGL, Ignore or not?
Posted by MarkS
on 04 November 2011 - 11:05 AM
Here is the debug output from a project I am currently working on:
'3D Maze.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\opengl32.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\glu32.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\ddraw.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\dciman32.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Users\Kids\Documents\Visual Studio 2010\Projects\3D Maze\3D Maze\glew32.dll', Binary was not built with debug information. '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded. '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded. '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Program Files (x86)\Common Files\microsoft shared\ink\tiptsf.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file '3D Maze.exe': Loaded 'C:\Windows\SysWOW64\nvoglv32.dll', Cannot find or open the PDB file
With the exception of 'glew32.dll", all of the listed DLLs came with Windows or Visual Studio.
#4786126 Survey: What do you think about the Bible?
Posted by MarkS
on 15 March 2011 - 12:33 PM
You've used the old argument of redefining what a day is. Let's assume for a minute that creation story is true, and that god told someone about the origin of the universe. He's god, so he knows everything which means by definition, he knows what the human concept of a "day" is. So why mislead?
AndyGeers answered this best. The Bible is full of translation errors such as this. There (as in English) were words that meant vastly different things, depending on various factors. The story of Noah (another topic in and of itself!) is one glaring example of this since the ancient Hebrew word for "country", "land", and "world" are one in the same.
Again, you can argue the "prime mover" view of god, i.e. Einsteins God of physical laws who set up the initial parameters for the universe (the physical constants) and let the whole thing unfold, but that is redefining the term creationist as most people understand it.
Yes! That is redefining "creationist"! That is exactly what I am trying to do! As "Creationism" is currently defined, it is pure bunk. It doesn't have to be that way though and it is currently that way because of absurd teachings for millennia.
You must understand that the teachings that sprouted up concerning this subject happened at a time when there was no understanding of the earth, solar system or universe. All they had to go on was a text that was full of holes. It persisted for so long because when we finally did start to have a more in depth understanding of the universe, this new understanding countered the teaching and those that dared to do so were branded heretics (often at great personal cost). As such, even today, most people argue the teaching at expense of the text. Many of them were raised in Christian (or at least creationist) homes and have their minds full of this. That is why I posted earlier that people should clear their minds of the teaching and read.
I wasn't even aware that Einstein thought of this, BTW.
#4785694 Survey: What do you think about the Bible?
Posted by MarkS
on 14 March 2011 - 12:24 PM
..snip..
Two things that I find interesting about Genesis more than anything else.
1.) When a planetary system is formed, the planets (and the planetary system as a whole) are formless and empty until they gather enough dust and debris and cool. Per scientific theory.
2.) For years, scientists have bristled at the thought that there was light before the formation of the sun. Just not possible. Can't happen. Ludicrous! Until a couple of years ago when scientists speculated that shortly after the universe was "created", it was flooded with light. As though someone flipped on a light switch. What was darkness was filled with light. Interesting.
Now, let's look at the verse where God defines day. He called the light day and the darkness night. No where in the Bible is a 24 hour day mentioned. That is a human construct. Nor is it mentioned that day has any relevance to the rotation of the earth or brightness of the sun. If the universe was dark for 300,000 earth years (I believe that is the time frame I read) before it was flooded with light and then the light took a million or so earth years to dim into background radiation, it stands to reason that this period is the length of "day" as described in Genesis. Still too short of a time period per scientific theory, but far longer than 6 24-hour days.
My point is that we do not know everything and our understanding of the universe grows daily. To summarily dismiss a line of thought because it goes against our current understanding doesn't make that line of thought wrong. What makes creationism so hard for scientists to stomach isn't so much what was written, but the fact that those that believe what was written so often flat out resist any thought that it isn't complete. If creationists are so (nearly violently) opposed to any form of scientific thought and theory, then there is no point trying to reconcile the two. I have as much disdain for close minded creationists as I do for closed minded evolutionists.
#4785401 Survey: What do you think about the Bible?
Posted by MarkS
on 13 March 2011 - 05:49 PM
Hence, bollocks.
Go back to my original posts in this thread. Only a fanatic wouldn't accept that the creation story is not complete. It wasn't meant to be. I've explained why several pages ago.
Indeed.
So, I take it you are happy being closed minded? I am a creationist and I am open to so much more. I realize that the creation story is not complete and am willing to accept scientific thought and theory to fill those holes. You are not even willing to entertain the thought? What purpose do you have in this thread?
#4766874 A request for beginners posting in this forum...
Posted by MarkS
on 29 January 2011 - 08:15 PM
My point is that this is expected and OK. Even those of us that are "experienced" sometimes ask "silly" questions. We promise not to laugh!
Please, if you ask a question here, regardless of how you feel with the answer, respond to the thread. Don't leave us hanging. We answer, not to make fun, but to help. If you get embarrassed and let the thread "die", we have no way of knowing if our answer was helpful or what you needed. If someone *DOES* reply in a belittling fashion, report them to a mod, but please, reply.
#4765413 Math operation can't be used in Case statement.
Posted by MarkS
on 26 January 2011 - 08:44 PM
1.) You put a semicolon after the switch statement.
2.) You forgot the << between the "=" and the (num1 .. num2).
3.) You forgot the semicolon after the while statement.
Works fine now...
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double num1;
double num2;
char operation;
char again;
do
{
cout << "Enter math expression:\n";
cin >> num1 >> operation >> num2;
switch (operation)
{
case '+':
cout << "=" << (num1 + num2) << endl;
break;
case '-':
cout << "=" << (num1 - num2) << endl;
break;
case '*':
cout << "=" << (num1 * num2) << endl;
break;
case '/':
cout << "=" << (num1 / num2) << endl;
break;
}
cout << "Do you want to try again <y or n>\n";
cin >> again;
}while (again == 'y' || again == 'Y');
system("pause");
return 0;
}
- Home
- Viewing Profile: Reputation: MarkS