Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-01-2009, 09:58 AM   #1 (permalink)
New Member
 
Join Date: Jun 2009
Posts: 10
Default Help me initialize OpenGL ES in a View-based app

Hello,
I am writing a view-based app in which when I press a button, a new view with opengl triangle should be displayed.

I know changing views using addSubview and I also know how to write opengl triangle code. But, I don't know in what method to put the opengl code in! Do I have to write a renderScene() and then link to UIView glview ?
Please help me.
warcrow is offline   Reply With Quote
Old 07-02-2009, 10:37 PM   #2 (permalink)
New Member
 
Join Date: Jun 2009
Posts: 10
Default

anyone?
warcrow is offline   Reply With Quote
Old 07-06-2009, 01:46 PM   #3 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: Washington, DC
Posts: 91
Default

Have you checked out the same openGL app? It does all of this. You can create the sample app like this:

1) Open XCode
2) Go to the 'File' menu and select 'New Project'
3) On the left side pick iPhone OS and Application, on the right side pick OpenGL ES application.

This will create a new project with a sample OpenGL application. You can use this as the starting point for any openGL ES based app.

-Keith
kshep is offline   Reply With Quote
Old 07-10-2009, 02:02 AM   #4 (permalink)
New Member
 
Join Date: Jun 2009
Posts: 10
Default

Yes sir, I know that. I already have a view based application in which I have to add opengl es view as a subview. I want to know how do I initialize the opengl es view in such a case. Is it possible?
warcrow is offline   Reply With Quote
Old 10-13-2009, 02:53 AM   #5 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 2
Default

i m also having the same problem. i m writting a view based appliacation n after moving along 3 nib files an opengl screen appears but i hv no idea how to do this.
anyone out there who knows the method plz help me
thanks in advance
regards
Syeda Aasma is offline   Reply With Quote
Old 01-05-2010, 05:18 AM   #6 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 1
Default

I am also facing similar problem. Was anyone able to solve it? Please let me know.
Thanks.
viruapatil is offline   Reply With Quote
Old 01-07-2010, 01:51 AM   #7 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 2
Default

Hi
I sorted out the problem
there are 2 alternative ways to do this
1. add new UIViewController subclasses to your EAGLView project
2. start a new view based application and then add all your EAGLview classes into it.
import ur EAGLView.h class into viewcontroller .h class and create an object of it. e.g.,
#import "EAGLView.h"
........
EAGLView *myGL;

then ue the following linnes of code to switch from your view controller to gl view

myGL = [[EAGLView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
myGL.animationInterval = 1.0 / 60.0;
[myGL startAnimation];
self.view = myGL;
[myGL release];

your IBOutlet will pass on the controll to the glview.
Syeda Aasma is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,198
Threads: 38,971
Posts: 170,968
Top Poster: smasher (2,567)
Welcome to our newest member, Hendrika
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:47 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0