• Content count

  • Joined

  • Last visited

Community Reputation

139 Neutral

About telaryus

  • Rank
  1. Odd issue when rendering

    All right, got it fixed. It's been too long since I last touched graphics stuff so I forgot about the whole 0.5 pixel location thing. Which is one of the reasons that I'm doing this... experiment.   And yes, I realize that pushing to a texture and rendering a quad is the better solution but when I looked for how to do this, all I got was this whole binding a frame buffer to a texture and doing the draw calls to that. Ergo, it seemed pointless to go that route.   Thanks.
  2. Odd issue when rendering

      From what I saw, rendering to a texture was about as equivalent to rendering to the screen. i.e. you just targeted a different framebuffer that was bound to a texture.   Maybe I missed something?
  3. Odd issue when rendering

    The first image shows the issue: when I draw points on the left half of the screen it seems to decide to skip a few columns. It's an 800x600 window and I'm drawing 800x600 points.   Second and third images show me drawing my rasterizer to a localized region of the window (400x300 points).   --   No, as it is an array that I am indexing. As such, the rows are calculated as (i / width).   --   Because I was referencing openGL books I had on hand.   -- It's just frustrating that I tell the thing to render 800x600 points and it apparently gets lazy halfway through.
  4. Alright... short story is that stuff like this always happens when I try and do graphics. One thinks I would learn, but apparently I'm a masochist. So...   Nothing really fancy, small project that sets up a window to draw to.   What I am trying to achieve, for personal reasons, is to write my own rasterizer.   So first things first here are some links to the issue that I am encountering:   And here is the code: Creating the view: wglMakeCurrent(hdc, hglrc); glClearColor(0.5f, 0.1f, 0.15f, 1.0f); glClearDepth(1.0f); glShadeModel(GL_FLAT); int width = 0; int height = 0; _renderTarget->GetSize(&width, &height); glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-width/2, width/2, -height/2, height/2, -1.0, 1.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity();       Render the fixed function test background glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); glRotatef(_spin, 0.0f, 0.0, 1.0f); glColor3f(0.3f, 0.1f, 0.15f); glRectf(-150.0f, -150.0f, 150.0f, 150.0f); glPopMatrix(); _rasterizer->Render(); HDC hdc = GetDC(_renderTarget->GetHandle()); SwapBuffers(hdc); ReleaseDC(_renderTarget->GetHandle(), hdc);       Render my rasterizer glBegin(GL_POINTS); glPushMatrix(); int const RenderBufferSize = m_bufferWidth * m_bufferHeight; for (int i = 0; i < RenderBufferSize; ++i) { int x = i % m_bufferWidth; int y = i / m_bufferWidth; int halfWidth = m_bufferWidth / 2; int halfHeight = m_bufferHeight / 2; glColor4ubv(m_renderBuffer[i]); glVertex2i(x - halfWidth, halfHeight - y); } glPopMatrix(); glEnd();   Hopefully that is enough info, if not just ask.   Any help is greatly appreciated.
  5. i need help with a c program

    Looks to be because your quancalc() function takes an array of numbers, but you are trying to pass it a single value. [code] int quancalc(int[]); //... printf("\n Item Quantity: \n"); quancalc(arr[i].Pnum); [/code] The quancalc function looks wrong too. You are indexing an array of numbers but no where in your program have you created such an array. I think maybe you meant to pass a single int value by address in which case this would be what you are looking for: [code] void quancalc(int*); //... printf("\n Item Quantity: \n", arr[i].quantity); quancalc(&arr[i].quantity); //... void quancalc (int *x){ int qhand, sold; printf("\n Item amount sold: "); scanf("%d",&sold); (*x)-=sold; } [/code] I'm not positive that this is the functionality you are looking for, but from what I can glean from your code it looks like it might be. Also you try to read into B which doesn't exist in your program. [code] //... printf("\n Please enter item number: "); scanf("%d",&; // Assuming this should be 'b' //... [/code] Also make sure that you initialize your variables, otherwise you'll have a lot of undefined behavior throughout your program.
  6. Statically Linking and Stuff

    What is the actually link error you are getting? I am able to have both <windows.h> and <Windowsx.h> with /MT[d] enabled.
  7. Passing Array into function C++ issue

    Simple solution use _countof() [url=""]Link[/url]
  8. How fast to move on diagonal line so it appears same speed.

    If I understand you correctly, then the solution will have to do deal with vector math. Which in all simplicity is just an x, y direction going at some interval or speed. As a simple example let us say that your line is 3 across and 4 up. So you have a line length of 5. That would mean that your step is 1.25 even though the slope should be 1.33. (that concerns me.) To get the proper scaling we would need to take the proportions of the x, y directions. This is obtained by "normalizing" or dividing the components by the magnitude (line length.) So proportionally: x = 0.6 and y = 0.8 with these values the line length it computed is 1 (x^2 = .36; y^2 = .64; sqrt( 1 ) = 1.) Now if we want to move along this line with a consistent speed in regards to other directions we take these proportional x, y values and multiply them by how fast they need to move. 0.6 *= elapsedTime * ball.getSpeed(); 0.8 *= elapsedTime * ball.getSpeed(); Math concepts that help make sense of this are Pythagorean Theorem and Unit Circle. Hope that helps.
  9. C++ objects heap or stack?

    Depends on whether you dynamically allocate it or not.
  10. [Pygame] Ship Power up not working.

    From the look of things Lines 205-215 where the rest of the code is for updating the screen, you aren't drawing the power-ups. [code] screen.blit(bg,(0,0)) enemy.clear(screen, bg) bullet.clear(screen, bg) powerup.clear(screen,bg) if lives > 0: allsprites.clear(screen, bg) enemy.update() bullet.update() powerup.update() if lives > 0: allsprites.update() enemy.draw(screen) bullet.draw(screen) powerup.draw(screen) [/code] I added three lines in regards to the power-ups, can't hi-lite them do to fail on nested formatting >.>
  11. building freeglut VS2005

    It's because people are awesome and the file formatting is Unix based which means there is no carriage return. So that needs to be fixed. The easiest way I found to do it is the following: right-click ->Open With... -> WordPad just do a quick ctrl+s to "save" the file and then close it. You don't need to save as or anything just let something touch it and change the line endings and is should work fine.
  12. class function prototypeing question

    Another point to think about is what if that header goes along side a library. The end-user doesn't have access to the information inside of the library and will never be able to see how the parameters are used. The latter option will at least given them some kind of hint. Self-documenting code is the best outcome you can probably have. But nonetheless keeping documentation up to date is always handy.
  13. Profiling

    You can try using [url=""]AMD CodeAnalyst Performance Analyzer[/url].
  14. installshield for mac

    You can try Installer. Which, if you have a Mac OS X machine, should already be installed. Otherwise another option might be LANrev InstallEase
  15. good source control system

    If you are actually running on Mac OS and not windows then some ones to look at: [url=""][/url] [url=""][/url] [url=""][/url] [url=""][/url] I don't have any first hand experiences with these apps, so you might have to try them out.