• 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
Vero

Installing GLEW.h libraries for VS express 2010

5 posts in this topic

I having some serious issues trying to get the GLEW libraries to compile without linker errors any help would be appreciated.

[code]

#include <Windows.h> // Header File For Windows
//#include <GL/GL.h> // Header file for OpenGL32 Library
//#include <GL/GLU.h> // Header File for GLu32 Library
#include <stdio.h>
#include <stdarg.h>
#include "aMaze_Objects.h"
#include <gl\glew.h>
#include <GL/glut.h>
#include "SOIL.h"
[code]

here's the error log when i try to compile. I've tried numerious folders to place the bin lib and include files

1>------ Build started: Project: aMaze, Configuration: Debug Win32 ------
[b]1>aMaze_Main.obj : error LNK2019: unresolved external symbol __imp__glewInit referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
1>aMaze_Objects.obj : error LNK2001: unresolved external symbol __imp____glewBlendFuncSeparate[/b]
1>C:\Users\Varonec\Dropbox\Game\aMaze\Debug\aMaze.exe : fatal error LNK1120: 2 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I have tried searching the internet and I've read this link up and down:
file:///C:/Users/Varonec/Downloads/glew-1.7.0-win64%281%29/glew-1.7.0/doc/install.html

anyway, I'm not sure where I can go from here
0

Share this post


Link to post
Share on other sites
Thank you so much for clearing that up. I'm finally able to get the glew libraries to compile and use the glew functionality.

So, I suppose there is a part two to this sadly. What I'm trying to accomplish is masking. Too Keep things simple the whole thing is done in glOrtho. I'm trying to create a sprite and the first step right now is rendering a texture and making everything outside of the draw part of the image transparent. the following is the draw function so far with no success in masking. there is nothing behind the drawn image only a black background right now. (no rendered quad or anything.)

[code]
GLvoid MPlayer::Draw()
{
glEnable(GL_TEXTURE_2D);
glColor4f(1.0f,1.0f,1.0f,1.0f);
glLoadIdentity();
glTranslatef(fPosition.x,fPosition.y,0.0f);
//glRotatef(spin,0.0f,0.0f,1.0f);
glBlendFunc(GL_DST_COLOR,GL_ZERO);
glBindTexture(GL_TEXTURE_2D,mask[0]);
glBegin(GL_QUADS);
glTexCoord2f(0,0); glVertex2i( 3 , interval-2); //start drawing
glTexCoord2f(0,1); glVertex2i( 3 , 3);
glTexCoord2f(1,1); glVertex2i( interval-2, 3);
glTexCoord2f(1,0); glVertex2i( interval-2, interval-2);
glEnd();
// glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA);
glBlendFunc(GL_ONE, GL_ONE);
glBindTexture(GL_TEXTURE_2D,sprite[0]);
glBegin(GL_QUADS);
glTexCoord2f(0,0); glVertex2i( 3 , interval-2); //start drawing
glTexCoord2f(0,1); glVertex2i( 3 , 3);
glTexCoord2f(1,1); glVertex2i( interval-2, 3);
glTexCoord2f(1,0); glVertex2i( interval-2, interval-2);
glEnd();
glDisable(GL_TEXTURE_2D);
glBlendFunc(GL_SRC_ALPHA,GL_ZERO);
}
[/code]
0

Share this post


Link to post
Share on other sites
First, I do not see a call of glEnable(GL_BLEND).
Second, are you sure the image contains an alpha channel and that the loading function you use loads the alpha channel and uploads it correctly to the texture?
Third, you probably want glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) or the inverse, depending on your alpha setup.
0

Share this post


Link to post
Share on other sites
Ok, I've created an simple little image it's a 32x32 pixel image with a white background in MSPaint. then I created a second image this one is a copy of the 1st image only any part that had color was replaced with white and the rest of the image was filled in as black.

Do I need to do something special to either image within the image editor? would I need to install something like GIMP to do so? or is MS paint in windows 7 capable of something that advanced? I uploaded the images into the program with SOIL. source: [url="http://www.lonesock.net/soil.html"]http://www.lonesock.net/soil.html[/url]

Image loader function:
[code]
bool MPlayer::LoadObjTexture(char *filename,int slot)
{
char *index = strchr(filename,'.');
char *mask= new char[0];
strncpy(mask,filename,index-filename);
mask[index-filename]='\0';
strcat(mask,"_mask.bmp");

if(MObject::LoadObjTexture(filename,slot,false)&&
MObject::LoadObjTexture(mask,slot,true))
return true;
else
{
MessageBox(NULL,L"Hero Sprite failed to Load",L"GAME ERROR",MB_OK|MB_ICONEXCLAMATION);
return false;
}
}

bool MObject::LoadObjTexture(char *Filename,int slot,bool isMask)
{
if(isMask)
{
mask[slot]=SOIL_load_OGL_texture
(
Filename,
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_INVERT_Y | SOIL_FLAG_MIPMAPS|SOIL_FLAG_NTSC_SAFE_RGB
);
if(mask[slot]==0)
return false;
else return true;
}
else{
sprite[slot]=SOIL_load_OGL_texture
(
Filename,
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_INVERT_Y | SOIL_FLAG_MIPMAPS|SOIL_FLAG_NTSC_SAFE_RGB
);
if(sprite[slot]==0)
return false;
else return true;
}
return false;
}
[/code]

Edit: glEnable(GL_BLEND) was declared in my initGL() function which is called at the start of the program. currently I've had no reason to disable blending Edited by Vero
0

Share this post


Link to post
Share on other sites
Just an FYI when getting Glew to compile, if you're comiling a 32bit program use the 32 bit libraries doesn't matter what your machine architecture is. Obvious problem was hidden in plain sight for me spent days banging my head against the keyboard when I couldn't compile and run my code on a different machine.
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