• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

fear4ever

Members
  • Content count

    31
  • Joined

  • Last visited

Community Reputation

135 Neutral

About fear4ever

  • Rank
    Member
  1. OpenGL

    I think you should start with c# or java and use the built in graphics API as they are pretty straight forward and require little effort to learn. You'll use eclipse/visual studio to write the code and intellisense will remember function names for you so you wont have to bother with 1- Graphics APIs/Frameworks 2- Function details/graphics pipelines 3- Windowing/keyboard-mouse input routines. You can easily focus on actual game development/algorithms/geometry calculations. By the time you create a game like snake that actually works you'll have learned a great deal about essentials of game programming. Then you can move to more professional stuff like OpenGL/DirectX
  2. Hello, As far as I can see glPolygonStipple isnt applied when glDrawPixels is called. Is there a way to make this work?
  3. Quote:Original post by fear4ever That overlay can be drawn by the c# application itself or maybe by some other dll. It doesn't really matter whether it gdi+ or anything else that does the drawing. What i am trying to find is the method of double buffered drawing onto a c# form (flicker free). As i understand OpenGL and gdi+ use different buffers for drawing so something like is not possible? in each timer tick clear_area() oglDLL.draw() //dont swap buffers yet some_other_dll.draw() //dont swap buffers yet gdi+.draw() //dont swap buffers yet swap_buffers() Any explanation or pointers to that kind of drawing tecnique would be appriciated.
  4. Hi I am trying to create a c++ dll which draws some stuff to a c# form (hWd passed as a parameter to the dll). It works fine up to that point. I put a timer to the c# application and it calls the dll's draw method on each tick. What I am trying to add now is an overlay on top of what is drawn by the c++ part. That overlay can be drawn by the c# application itself or maybe by some other dll. Is that possible? And if so how do i go about it? Something like void tick() { openGL_Part.draw(); draw_Some_Stuff_On_Top_Of_That(); }
  5. I have played a bit around with the code. First off the HBITMAP i created was not getting the info from CBitmap bmp; so i decided to get pixel directly from it. and changed 24 color depth to 32 which is my desktop resolution. At last i got some output but half the picture is still in black. What could be the reason? // CDenemeView drawing void CDenemeView::OnDraw(CDC* pDC) { CDenemeDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here // bitmap dimensions RECT windowRect; GetWindowRect(&windowRect); int bitmap_dx = windowRect.right - windowRect.left; int bitmap_dy = windowRect.bottom - windowRect.top; CPaintDC odc(this); CBitmap bmp; CDC dc; dc.CreateCompatibleDC(&odc); bmp.CreateCompatibleBitmap( &odc, bitmap_dx, bitmap_dy ); dc.SelectObject(&bmp); //fill the area for ( int x = 0; x < bitmap_dy; x ++ ) { for ( int y = 0; y < bitmap_dx; y ++ ) { dc.SetPixel(x,y, RGB(x%256,y%256,(x+y)%256)); } } // create file ofstream file("example.bmp", ios::binary); if(!file) return; // save bitmap file headers BITMAPFILEHEADER fileHeader; BITMAPINFOHEADER infoHeader; fileHeader.bfType = 0x4d42; fileHeader.bfSize = 0; fileHeader.bfReserved1 = 0; fileHeader.bfReserved2 = 0; fileHeader.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); infoHeader.biSize = sizeof(infoHeader); infoHeader.biWidth = bitmap_dx; infoHeader.biHeight = bitmap_dy; infoHeader.biPlanes = 1; infoHeader.biBitCount = 32; infoHeader.biCompression = BI_RGB; infoHeader.biSizeImage = 0; infoHeader.biXPelsPerMeter = 0; infoHeader.biYPelsPerMeter = 0; infoHeader.biClrUsed = 0; infoHeader.biClrImportant = 0; file.write((char*)&fileHeader, sizeof(fileHeader)); file.write((char*)&infoHeader, sizeof(infoHeader)); // save dibsection data int bytes = (((32*bitmap_dx + 31) & (~31))/8)*bitmap_dy; char *memory2= (char*)malloc(sizeof(char)*bytes); bmp.GetBitmapBits(bytes,memory2); file.write((char*)memory2, bytes); DeleteObject(bmp); DeleteDC(dc); DeleteDC(odc); file.close(); }
  6. Hello. I am having a problem creating and saving an image as bmp in a MFC application. Project is created by VS6 from mfc appication wizard(exe) with standard options. This is the source of the onDraw method. This creates a bitmap and draws to screen. Also creates a bmp file of application size but its just black. What am i doing wrong? // CDenemeView drawing void CDenemeView::OnDraw(CDC* pDC) { CDenemeDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here // bitmap dimensions RECT windowRect; GetWindowRect(&windowRect); int bitmap_dx = windowRect.right - windowRect.left; int bitmap_dy = windowRect.bottom - windowRect.top; CPaintDC odc(this); CBitmap bmp; CDC dc; dc.CreateCompatibleDC(&odc); bmp.CreateCompatibleBitmap( &odc, bitmap_dx, bitmap_dy ); dc.SelectObject(&bmp); //fill the area for ( int x = 0; x < bitmap_dy; x ++ ) { for ( int y = 0; y < bitmap_dx; y ++ ) { dc.SetPixel(x,y, RGB(x%256,y%256,(x*y)%256)); } } // create file ofstream file("example.bmp", ios::binary); if(!file) return; // save bitmap file headers BITMAPFILEHEADER fileHeader; BITMAPINFOHEADER infoHeader; fileHeader.bfType = 0x4d42; fileHeader.bfSize = 0; fileHeader.bfReserved1 = 0; fileHeader.bfReserved2 = 0; fileHeader.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); infoHeader.biSize = sizeof(infoHeader); infoHeader.biWidth = bitmap_dx; infoHeader.biHeight = bitmap_dy; infoHeader.biPlanes = 1; infoHeader.biBitCount = 24; infoHeader.biCompression = BI_RGB; infoHeader.biSizeImage = 0; infoHeader.biXPelsPerMeter = 0; infoHeader.biYPelsPerMeter = 0; infoHeader.biClrUsed = 0; infoHeader.biClrImportant = 0; file.write((char*)&fileHeader, sizeof(fileHeader)); file.write((char*)&infoHeader, sizeof(infoHeader)); // dibsection information BITMAPINFO info; info.bmiHeader = infoHeader; //for checking if dc has correct drawing pDC->BitBlt( 0,0,bitmap_dx, bitmap_dy, &dc,0,0,SRCCOPY); BYTE *memory; SelectObject(dc, bmp); HBITMAP bitmap = CreateDIBSection(dc, &info, DIB_RGB_COLORS, (void**)&memory, 0, 0); // save dibsection data int bytes = (((24*bitmap_dx + 31) & (~31))/8)*bitmap_dy; file.write((char*)memory, bytes); DeleteObject(bmp); DeleteDC(dc); DeleteDC(odc); file.close(); }
  7. OpenGL

    Yes you are right. Basically i wanted to develop a GUI based opengl application. Nehe's window system works just fine but controlling everything with keyboard is not possible when you want to create an actual application. SDL is not any different as far as i can see. Anyway i did manage to integrate opengl/vb/c++. After a bit of a work i'll hopefully have a simple framework where vb controls user input and c++ handles application logic and opengl. Thanks for the replies.
  8. OpenGL

    Thanks edgar. I did manage to make it work by creating a simple atl com object and linking to vb. This brings some problems with it of course i.e i have to prevent vb from drawing over opengl stuff by running it in a closed loop. Still it works and will save me some time while designing a GUI. Hopefully i'll have a generic framework for future use. I also looked into SDL a bit. It seems quite nice but is there a form editor type tool for creating GUI's based on it?
  9. Hi, I am trying to create a simple windows opengl application. For GUI i decided to use visual basic. I know people can code opengl in vb using a tlb file which i cannot remember the exact name for but that's not i am after. I am looking for a way to implement only GUI in VB and all application code in visual c++. That means i'll have a dll that initiliazes opengl using the window handle of vb, vb will pass GUI events to that/or another dll responsible for application impelemtatioin. Is that possible? I tried to create a simple win32 dll with VS/c++ and reference it in a VB app but that doesnt seem to work. Do i have to create an mfc activeX control instead of a regular dll? (That i tried and managed to link the ocx file to vb but is creating a control best way to do this?) I am also open for suggestions about the platform to implement the GUI (MFC is a bit too complicated and glut/glui do not have a good application feel). Thanks in advance.
  10. This is not a homework. I am trying to build a pipe around a curve, the normals at curve points need to match so i can create circles around it and connect them with triangle strips. BeanDog, your methods seems like it will work. I am not very good with linear algebra, so i'll try to implement this and let you know. Thanks for replies
  11. Hi, I have 2 vectors. a=[x1,y1,y1] b=[x2,y2,z2] Now somehow the vector a is rotated to a'=[x1',y1',z1'] a' is given without the rotation matrix that produced it. What i need is to rotate the vector b the same way vector a has been rotated to obtain b'=[x2',y2',z2']. Any (if possible easy) way to do this? Thanks
  12. Thanks a lot. I just cannot see such typos especially it is me who made them :( This works fine now.
  13. OpenGL

    This page shows how to set up lights. Specifiying spotlight properties. Hope it helps
  14. I have written a simple program to implement this. Here is a link to MSVS 6 workspace (10kb) Source I am using a bezier curve. You can play with resetControl() function to specify diffrent control points and get diffrent curves. The pipe is generated with some weird looking parts especially at curving regions. I could not figure out if this is due to the 3D structure of it or not. (I think something is definetely wrong though). If you have time to download and have a look at it please check the "circlesFromCurve" function and let me know if there is any problem there. For those who dont have time to download the source, this is the function. double PI = acos(-1); const float DEG2RAD=PI/180; typedef struct { double x; double y; double z; }Point3D; typedef struct { Point3D* points; int n; }Circle; /*This func generates a circle for each point on curve *cn is numner of curve points that i will generate circles for *res is resolution of circles(number of points per circle) */ Circle* circlesFromCurve(Point3D* curvePoints,int cn, int res, double radius) { Circle* circles=(Circle*)malloc(sizeof(Circle)*cn); Point3D pRandom; pRandom.x=1; pRandom.y=1; pRandom.z=1; for(int i=0;i<cn-1;i++) { Point3D pDirection; Point3D axis1,axis2; pDirection.x=curvePoints[i+1].x-curvePoints[i].x; pDirection.y=curvePoints[i+1].y-curvePoints[i].y; pDirection.z=curvePoints[i+1].z-curvePoints[i].z; axis1.x=pDirection.y*pRandom.z - pDirection.z*pRandom.y; axis1.y=pDirection.z*pRandom.x - pDirection.x*pRandom.z; axis1.z=pDirection.x-pRandom.y - pDirection.y*pRandom.x; axis2.x=axis1.y*pDirection.z - axis1.z*pDirection.y; axis2.y=axis1.z*pDirection.x - axis1.x*pDirection.z; axis2.z=axis1.x-pDirection.y - axis1.y*pDirection.x; double l=axis1.x*axis1.x+axis1.y*axis1.y+axis1.z*axis1.z; axis1.x=axis1.x/sqrt(l); axis1.y=axis1.y/sqrt(l); axis1.z=axis1.z/sqrt(l); l=axis2.x*axis1.x+axis2.y*axis2.y+axis2.z*axis2.z; axis2.x=axis2.x/sqrt(l); axis2.y=axis2.y/sqrt(l); axis2.z=axis2.z/sqrt(l); circles[i].n=res; circles[i].points=(Point3D*)malloc(sizeof(Point3D)*res); double step=360/res; for(int j=0;j<res;j++) { double degree=j*step*DEG2RAD; double vcos=sin(degree)*radius; double vsin=cos(degree)*radius; circles[i].points[j].x=curvePoints[i].x+axis1.x*vcos+axis2.x*vsin; circles[i].points[j].y=curvePoints[i].y+axis1.y*vcos+axis2.y*vsin; circles[i].points[j].z=curvePoints[i].z+axis1.z*vcos+axis2.z*vsin; } pRandom.x=pDirection.x; pRandom.y=pDirection.y; pRandom.z=pDirection.z; } return circles; }