0% found this document useful (0 votes)
2 views1 page

Getting Started With Graphics Programming On A Mac RGraphicsProgramming

A user with a programming background in C/C++ is seeking advice on getting started with graphics programming on a Mac, facing challenges with OpenGL being deprecated and difficulties in using Metal with Swift/Objective-C. They are considering switching to WebGL for easier experimentation and project sharing. Various community members suggest alternatives and provide insights on using OpenGL, Metal, and WebGL for graphics programming on macOS.

Uploaded by

hs9117087
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Getting Started With Graphics Programming On A Mac RGraphicsProgramming

A user with a programming background in C/C++ is seeking advice on getting started with graphics programming on a Mac, facing challenges with OpenGL being deprecated and difficulties in using Metal with Swift/Objective-C. They are considering switching to WebGL for easier experimentation and project sharing. Various community members suggest alternatives and provide insights on using OpenGL, Metal, and WebGL for graphics programming on macOS.

Uploaded by

hs9117087
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Use App Log in

r/GraphicsProgramming
by baption0 1 yr. ago

Getting started with graphics


programming on a mac?
To start, I am not new to programming. I have a
background in C/C++, and I want to dabble with graphics
programming because why not.

I've been trying to get into graphics programming for a


couple of days, but I've run into a roadblock. OpenGL is
deprecated on apple, so getting stuff to compile in C++
has been a pain in the ass. On the other hand, Xcode w/
metal works first try but I'm finding it an entire task and a
half to catch up with swift/objective c/their entire dev
model with minimal help online (I'm still stuck on getting a
spinning colored cube).

Read
I'm more
considering ditching Metal and taking a second shot at
OpenGL. If there is some obscure blog post to get opengl
to compile
19 or some godsend
33 metalShare
tutorial, I haven't found
it yet. I would appreciate any help, or direction on which
path to trudge through.
Sort by: Best 33 comments
Edit: Thank you to everyone who replied. I decided to move
forward with webgl because starting projects and
experimenting is unparalleled in JS. I think the abstractions
are fine because most of Add
theabattle
Commentis with buffers and
vertices anyways, so it's just as good a place to start as
any. Also, the ability to share what I make easily is a big
plonkmaster_jones • 1 yr. ago
plus.

You could always try WebGL (which is a subset of


OpenGL) and run things in the browser. I'm sure
Apple hasn't deprecated support for WebGL
because a great deal of the graphical web still runs
on it. If they have, I'm not sure how to help!

16 Reply Share

6 more replies

ephimetheus • 1 yr. ago

OpenGL is deprecated but still works on the latest


OS releases, and they even implemented in the
new Apple Silicon chips. For now I’ve been sticking
to OpenGL

I haven’t encountered problems compiling and


running C++ OpenGL code with glad or glbinding
on top of GLFW. I didn’t have to write any objective
c or swift code so far.

I think if you use cmake it should be relatively


straightforward.

8 Reply Share

PurpleSamurai0 • 1 yr. ago

I’m using OpenGL 3.3, and it’s working just fine -


great performance on MacOS. Note: to link with
OpenGL, use ‘-framework OpenGL’ with gcc or
clang.

7 Reply Share

1 more reply

charboola • 1 yr. ago

You can do c++ with a mix of objective-c. just the


api calls and api types would be in objective-c.
Here's an example:
https://github.com/ConfettiFX/The-
Forge/blob/master/Common_3/Renderer/Metal/Met
alRenderer.mm

5 Reply Share

the_Demongod • 1 yr. ago

It's convoluted, but you could use MoltenVk


(Vulkan implemented on top of Metal) together
with Zink (OpenGL implemented on top of Vulkan).
I've never tried it before, but in theory it should
allow you to use modern OpenGL on a mac. Not
sure what sort of performance or other issues will
be introduced, but I'd say it's worth a shot.

Edit: darn, unfortunately MoltenVk only goes to GL


2.1, so never mind. My next recommendation would
be to buy a cheap linux machine :)

4 Reply Share

5 more replies

Hindrik1997 • 1 yr. ago

Try swift with metal. It’s a breeze in my experience.


Of all the modern API’s metal is by far the easiest
to work with.

3 Reply Share

2 more replies

nibbertit • 1 yr. ago

I'm using the same opengl project on both win and


Mac and it's working great

2 Reply Share

1 more reply

Slackluster • 1 yr. ago

I'd recommend JavaScript. Seriously, I also come


from 20 years of C++ programming and I love it.

You can use Three.js to easily do 3D stuff at a


reasonably low level.

Also, the vanilla javascript webgl interface is pretty


easy to work with.

You can render a shader with less javascript code


then this comment.

2 Reply Share

1 more reply

wrosecrans • 1 yr. ago

OpenGL is deprecated on apple, so getting


stuff to compile in C++ has been a pain in
the ass.

FWIW, the deprecation of OpenGL didn't actually


change anything, or make it harder to compile C++
code. The latest OpenGL features aren't available,
but you'll need to deal with Mac platform specifics
when dealing with any kind of C++ regardless of
graphics API.

2 Reply Share

sort_of_sleepy • 1 yr. ago

Like others suggested, WebGL is probably the way


to go if you're just looking to dabble as there's
almost no setup needed other than downloading a
browser.

That said as it's almost ready for use on all


platforms, I might take this chance to learn the
WebGPU api instead; while the web is a main
focus, there is also concurrent development going
on for desktop with Dawn and wgpu. The
disadvantage I would say is that you'll have to
learn a new shader language but honestly, it's just
a really verbose; if you're comfortable with C/C++
you should get used to it fairly quickly.

Some other thoughts:

- If you're having trouble getting OpenGL stuff to


compile, while I have not checked on Monterey,
things like openFrameworks and Cinder still
compile fine on Mac last I looked. Granted you're
still limited to certain OpenGL versions but that's
at least something to try to get started.

- If you ever decide to give Metal another try,


assuming Objective-C hasn't died since I last tried
to work on a Mac, you can definitely write a
majority of your app with C++ if you really wanted
to.

1 Reply Share

4 more replies

More posts you may like

Related Programming

r/EmuDev · 1 yr. ago

Need help with Arm based Xbox emulator


1 upvote · 21 comments

r/opengl · 1 yr. ago

Is learning OpenGL worth it ?


8 upvotes · 14 comments

r/selfhosted · 1 yr. ago

[Question] I have a Windows VPS. Easy way


to get started with Self-Hosting?
13 comments

r/archlinux · 1 yr. ago

Is Arch with KDE+wayland on a Nvidia gpu


usable for you?
1 upvote · 11 comments

r/MacOS · 1 yr. ago

Can I run every program using Parallels?


2 upvotes · 5 comments

r/GraphicsProgramming · 14 days ago

You're all probably sick of these, but I'm


actually really amazed I got to this point.
122 upvotes · 11 comments

r/GraphicsProgramming · 27 days ago

Finally reached BRDF specular


and diffuse sampling in Ravi's…
course. This is the image I
102 upvotes · 17 comments
rendered for the homework stop.

r/GraphicsProgramming · 26 days ago

I added some simple physics in


OpenGL, and this happened
150 upvotes · 26 comments

r/VoxelGameDev · 15 days ago

A new picture of my ray tracing


voxel engine (Vulkan/RTX/Rust)
176 upvotes · 10 comments

r/opengl · 16 days ago

I want to share a custom OpenGL engine I


have been working on (StratusGFX - source…
code)
130 upvotes · 12 comments

r/proceduralgeneration · 13 days ago

A Procedural World's Simulated


Economy with Supply & Deman…
Heatmaps
261 upvotes · 7 comments

r/proceduralgeneration · 12 days ago

B-Noise, now without directional bias


184 upvotes · 35 comments

r/proceduralgeneration · 23 days ago

Textured radial gradients


130 upvotes · 6 comments

r/proceduralgeneration · 12 days ago

2 experiments w/ depth (designs w/ cellular-


automata)
128 upvotes · 13 comments

r/proceduralgeneration · 8 days ago

Making some Wave Function Collapse for


Grasshopper, WIP. 3d overlapping model.…
Need
151 a way
upvotes · 13 to work out conflicts better.
comments

r/proceduralgeneration · 26 days ago

Differential growth in Blender's Geonodes.


145 upvotes · 12 comments

r/proceduralgeneration · 17 days ago

Experimenting with shaped islands and Perlin


noise. Video link below.
134 upvotes · 18 comments

r/proceduralgeneration · 1 mo. ago

Creating valley with hydraulic erosion


210 upvotes · 9 comments

r/proceduralgeneration · 16 days ago

ORIGINAL

City Generation with WFC

223 upvotes · 25 comments

r/proceduralgeneration · 27 days ago

Shaded rounded irregular re-entrant


polygons
214 upvotes · 12 comments

r/proceduralgeneration · 8 days ago

Truchet kite tiles


151 upvotes · 10 comments

r/proceduralgeneration · 20 days ago

Working on procedural buildings


for a game
341 upvotes · 37 comments

r/proceduralgeneration · 24 days ago

Procedural generation of global


cloud cover
162 upvotes · 15 comments

r/proceduralgeneration · 1 mo. ago

Wiggly wiggly woo, WOB WOB


WOB wipwipwipw squelching…
sounds WOBWOBWOB fipfipfip
136 upvotes · 11 comments
zzzz fffttttptss

r/proceduralgeneration · 17 days ago

ORIGINAL

experiments with webGL

396 upvotes · 13 comments

This page looks better in the app Open

You might also like