• 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.
Sign in to follow this  
Followers 0
Caste

GL 3.0 basecde Beta for Windws and Linux(GLX)

6 posts in this topic

Hey everybody, after a long time with no news (we've been pretty busy with other projects) here's a new basecode! As OpenGL 3.0 drivers for NVidia cards are out for Windows and Linux now I've set something up for you: a sample for setting up an OpenGL 3.0 context. This code is not completely finished yet and lacks loads of comments (especially in the GLX window part), but its there for you to test and criticize! You need to have the appropriate drivers installed to run the code: Windows: Forceware 177.89 or later, GL 3.0 enabled with nvemulate as explained on the NVidia page Linux: Forceware 177.61 from the same nvidia page. Download it here and tell me what you think. There's a project file for: Linux - Code::Blocks: Lesson01GLX.cbp, you need libXxf86vm-dev installed Windows - Visual C++ Express: Lessn01Win.vcproj Please tell me about everything you don't like, don't understand, do like or whatever [smile]. Cheers Carsten (aka Caste) @ NeHe Team [Edited by - Caste on October 27, 2008 5:09:35 PM]
0

Share this post


Link to post
Share on other sites
Hello, I've posted that in the Alternative Game Libraries forum but I figured that since you've made a GL3 base code I might as well also ask here.

I was wondering how do you set up an OpenGL 3.0 rendering context with SDL v1.2.x (I know it'll be taken care of by SDL 1.3.x, but that isn't available yet) ?

As far as I know, here's what I'd do :
- create the window with SDL_SetVideoMode()
- get the window handle with GetActiveWindow()
- get the context handle with GetDC()
- (re)init the context in GL3 mode with wglCreateContextAttribsARB()
- maybe make it the current rendering context with wglMakeContextCurrentARB()

Which would give something like that :

SDL_SetVideoMode (width, height, 32, SDL_HWSURFACE|SDL_OPENGL);
HDC context = GetDC(GetActiveWindow());
int attribs []= {
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
WGL_CONTEXT_MINOR_VERSION_ARB, 0,
WGL_CONTEXT_FLAGS_ARB, 0, 0
};
HGLRC GL_context = wglCreateContextAttribsARB(context, 0, attribs);
wglMakeContextCurrentARB (context, context, GL_context);




Should this work ?

PS : I've seen the thread in SDL's mailing list and Sam Latinga's answer saying they'll implement GL3 context support in SDL 1.3 sometime soon. What I'm looking for is a temporary solution while waiting for that.
0

Share this post


Link to post
Share on other sites
The way you suggested is the way I would do it. It was me that asked the mailing list about GL 3 support in 1.3, but I looked at the commits the other day and as far as I can see hasn't been done yet. Perhaps I will prod the mailing list once more ;)
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Kazade
The way you suggested is the way I would do it.


Thanks, I think that I'll try it before the end of the week. I'll let you know how that goes.

Quote:
Original post by Kazade
It was me that asked the mailing list about GL 3 support in 1.3, but I looked at the commits the other day and as far as I can see hasn't been done yet. Perhaps I will prod the mailing list once more ;)


I took a look at the context creation functions that are defined in SDL/src/video/(driver)/sdl_(driver)opengl.c (replace (driver) by the driver's name, i.e win32 for Windows for example). Here it is :

SDL_GLContext
WIN_GL_CreateContext(_THIS, SDL_Window * window)
{
HDC hdc = ((SDL_WindowData *) window->driverdata)->hdc;
HGLRC context;

context = _this->gl_data->wglCreateContext(hdc);
if (!context) {
SDL_SetError("Could not create GL context");
return NULL;
}

if (WIN_GL_MakeCurrent(_this, window, context) < 0) {
WIN_GL_DeleteContext(_this, context);
return NULL;
}

WIN_GL_InitExtensions(_this, hdc);

return context;
}



Looks like it'd be the right place to make the changes necessary to support GL3, but those haven't been made yet [grin]
It just needs a way to pass the attributes to the function, maybe that could be done through the userdata member of the SDL_Window struct (if that isn't used somewhere else for something else).

While I'm here, I also have a question concerning your basecode. I see that you're setting up the attributes for the context like that :

int attribs[] = {
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,//we want a 3.0 context
WGL_CONTEXT_MINOR_VERSION_ARB, 0,
//and it shall be forward compatible so that we can only use up to date functionality
WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
0}; //zero indicates the end of the array


But NVidia's developer page concerning the GL3 driver says that Forward-compatible and Debug contexts aren't supported yet. So unless the page isn't up-to-date, those attributes won't work on any Nvidia card and WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB must be replaced by 0. Right ?

PS : I think I'm gonne subscribe to SDL's mailing list since I've got so many questions about it [lol]
0

Share this post


Link to post
Share on other sites
Quote:
But NVidia's developer page concerning the GL3 driver says that Forward-compatible and Debug contexts aren't supported yet. So unless the page isn't up-to-date, those attributes won't work on any Nvidia card and WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB must be replaced by 0. Right ?


Well partially right, yes.. It is not yet supported thats true, but atm it just does nothing.. you get a fully compatible GL3 context and once it is implemented in the drivers you'll be notified if you use deprecated functionality.

So.. leave it where it is [wink]
0

Share this post


Link to post
Share on other sites
Looking at the mailing list it seems like Sam has implemented some GL3 changes into SDL 1.3 it might be worth checking out the branch to test it.
0

Share this post


Link to post
Share on other sites
Hmmm... I can't see any new commits to SVN concerning the video part of SDL's source code.

Maybe he's made the modifications on a local copy and hasn't submitted them yet. However, he seems to need a snippet of 3.0 specific GL code easy to paste in his code in order to test the context created.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0